Ah apologies for my "bad answer". Im new, and was just trying to help.
Salem, maybe you can provide the correct way to do it (without declaring a string)?
Type: Posts; User: DEEP
Ah apologies for my "bad answer". Im new, and was just trying to help.
Salem, maybe you can provide the correct way to do it (without declaring a string)?
possibly. feel free to post your full code, assuming it is not too long. In the meantime, about this function.. test it out on its own. Open a new .c file, and type the following...
...
Actually, my code above worked perfectly fine for me..
I was thinking to keep it simple :) but then again, Im pretty new. See the following...
-Deep
int Get_Line_Ammount()
{
int amm_of_lines;
// this is your priming read
Hi,
The following line is your problem..both outside of the loop, and inside of it.
return_value = scanf("\n%d", &amm_of_lines);
you dont really need the "return_value =" part. replace...