Hi I"m new to C++ and I'm trying to learn how to use the stdio functions. Could anyone tell me why I get "Invalid Memory Reference (memory limit exceeded)" in my latest z-processor submission? I can't find my error.
C++ Help
scanf("%s", c)
expects c to be of type
char* is c type null terminated string.
Let me know if you want more details on why exactly you get bad memory reference error
expects c to be of type
char * c and not stringchar* is c type null terminated string.
Let me know if you want more details on why exactly you get bad memory reference error
Oh I see, thanks I'll keep that in mind.
got a problem with stdio also cause when i write smt like this
for(i=0;i<5;i++) scanf("%d\n",a)
...
the program keeps w8ing
it does not execute cause it is w8ing for smt to read cayse of \n and then i just type smt random and its ok...
but how can i avoid this?
for(i=0;i<5;i++) scanf("%d\n",a)
...
the program keeps w8ing
it does not execute cause it is w8ing for smt to read cayse of \n and then i just type smt random and its ok...
but how can i avoid this?
this is wrong: scanf ( "%d\n", a ). you have to write it like this: scanf ( "%d\n", &a );
ok i forgot about that:D
i do it right but how can i avoid this new line problem???:S
i do it right but how can i avoid this new line problem???:S
yes
???:D
for(var i=0;i<5;i++)
scanf("%d",a);
Try it like this.
You told the compiler it should search the input for an integer and a new line, so it would always wait for you to enter the numbers 5 times in separate lines.