Miscellaneous > Computers and Technology

:/ C language again

(1/2) > >>

Ameer:


Any idea why for is not stopping ? even after it reaches i = 7 :/ [Seems like I found a way to fix this problem as well, sorry for wasting your time lads :/ ]

another question is, why is it printing 3 and 4 at the same time, instead of waiting for scanf to finish its job ? [ Fixed this problem by having a space before %c, changed from scanf("%c"&c); ---------> scanf(" %c" &c);


Thomy:
Please show the full code, else nobody can help you: https://pastebin.com/

You might want to disable input/output buffering. Add the following lines to your code directly under main:
--- Code: ---setbuf(stdout, NULL);
setbuf(stdin, NULL);

--- End code ---

Ameer:

--- Quote from: Thomy on April 28, 2017, 10:19:52 am ---Please show the full code, else nobody can help you: https://pastebin.com/

You might want to disable input/output buffering. Add the following lines to your code directly under main:
--- Code: ---setbuf(stdout, NULL);
setbuf(stdin, NULL);

--- End code ---

--- End quote ---

https://pastebin.com/teuaNEKU

Ameer:
Seems like I've found a way to fix the problem, thanks for your time anyway
I appreciate it ;)

Thomy:
Sounds like a wrong pointer somewhere. Couldn't spot it by flying over your code. I'd recommend debugging it: https://www.gnu.org/software/gdb/ I've used gdb before for uni homeworks and found it useful.

Navigation

[0] Message Index

[#] Next page

There was an error while liking
Liking...
Go to full version