By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,778 Members | 1,318 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,778 IT Pros & Developers. It's quick & easy.

Assign one array to another array

P: 11
Expand|Select|Wrap|Line Numbers
  1.  
  2. wchar_t a[50];
  3. wchar_t b[50];
  4.  
  5. a=L"asdfgh";
why I cant say

b=a;

How to exchange values between tow wchar_t arrays
Oct 20 '10 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
You can't say b=a because the name of an array is the address of element 0.

The compiler will not let you chnage the address of a local variable.

You will need to copy one array to the other element by element.

Your problem has nothing to to with wchar_t but everything to do with arrays.

You might read: http://bytes.com/topic/c/insights/77...rrays-revealed
Oct 20 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.