------- Comment #7 from suren dot r at live dot in 2009-11-20 02:02 ------- (In reply to comment #6) > (In reply to comment #5) > > Mr. Andrew, > > I dont understand the term 'undefined code'. Are you saying this is not a > > bug? > > This is not a bug in GCC but the code you wrote. scanf's %d takes a pointer > to > an int variable and not a pointer to a char variable. >
This is a defacto standard in embedded industry to save memory. You can see the second value gets the number from the scanf correctly. why the first number can't? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42107