Click here to Skip to main content
15,913,453 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralC++ Pin
Mark J Jackson19-Jun-03 9:27
Mark J Jackson19-Jun-03 9:27 
GeneralRe: C++ Pin
Maximilien19-Jun-03 9:54
Maximilien19-Jun-03 9:54 
GeneralRe: C++ Pin
basementman19-Jun-03 9:59
basementman19-Jun-03 9:59 
GeneralVisual Studio Design Time Bug Pin
Qarash19-Jun-03 9:08
Qarash19-Jun-03 9:08 
General(Different) Question About Declarations Pin
yashraj121519-Jun-03 8:49
yashraj121519-Jun-03 8:49 
GeneralRe: (Different) Question About Declarations Pin
David Crow19-Jun-03 9:24
David Crow19-Jun-03 9:24 
GeneralRe: (Different) Question About Declarations Pin
Brian Delahunty19-Jun-03 10:14
Brian Delahunty19-Jun-03 10:14 
GeneralRe: (Different) Question About Declarations Pin
Michael Dunn19-Jun-03 12:06
sitebuilderMichael Dunn19-Jun-03 12:06 
yashraj1215 wrote:
char myvar[21] = "text";

This means "myvar is an array of 21 chars, and initialize the first five elements to the characters 't' 'e' 'x' 't' '\0'"

yashraj1215 wrote:
char myvar[21];
myvar[21] = "text";


This is incorrect code, that's why it doesn't compile. It's trying to assign an array of characters to one element in a character array.
It is also overrunning the array bounds. The elements are myvar[0] thru myvar[20]. Storing something in myvar[21] will overwrite other data.

--Mike--
"So where does that leave us? Well, it leaves us right back where we started, only more confused than before." -- Matt Gullett
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber

GeneralRegistry/String Questions Pin
yashraj121519-Jun-03 8:01
yashraj121519-Jun-03 8:01 
GeneralRe: Registry/String Questions Pin
AlexO19-Jun-03 8:09
AlexO19-Jun-03 8:09 
GeneralRe: Registry/String Questions Pin
yashraj121519-Jun-03 8:28
yashraj121519-Jun-03 8:28 
GeneralRe: Registry/String Questions Pin
David Crow19-Jun-03 9:06
David Crow19-Jun-03 9:06 
GeneralRe: Registry/String Questions Pin
AlexO20-Jun-03 4:14
AlexO20-Jun-03 4:14 
GeneralRe: Registry/String Questions Pin
David Crow19-Jun-03 9:19
David Crow19-Jun-03 9:19 
GeneralFirewall question Pin
Kuniva19-Jun-03 7:28
Kuniva19-Jun-03 7:28 
GeneralRe: Firewall question Pin
Joel Lucsy19-Jun-03 7:51
Joel Lucsy19-Jun-03 7:51 
GeneralRe: Firewall question Pin
basementman19-Jun-03 7:57
basementman19-Jun-03 7:57 
GeneralRe: Firewall question Pin
Kuniva19-Jun-03 11:36
Kuniva19-Jun-03 11:36 
GeneralRe: Firewall question Pin
Joel Lucsy19-Jun-03 14:34
Joel Lucsy19-Jun-03 14:34 
GeneralRe: Firewall question Pin
Robert Little19-Jun-03 8:04
Robert Little19-Jun-03 8:04 
Generalcapture wm_char message Pin
lucy19-Jun-03 7:19
lucy19-Jun-03 7:19 
GeneralRe: capture wm_char message Pin
Kuniva19-Jun-03 7:38
Kuniva19-Jun-03 7:38 
GeneralRe: capture wm_char message Pin
lucy19-Jun-03 8:00
lucy19-Jun-03 8:00 
Questionverify packets sent over com port? Pin
pramodastro19-Jun-03 7:05
pramodastro19-Jun-03 7:05 
GeneralPixel to inch conversion (just some basic maths) Pin
User 665819-Jun-03 7:04
User 665819-Jun-03 7:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.