![]() |
Need help running a program inside a program...
I'm just starting out with C hoping to move on to C++ in the future.
When I learn languages I normally make up my own examples to help me learn, and as its my first day with C the one I am working on is quite ambitious, but i'm determined to complete it. However all the different blocks of code are confusing my compiler (gcc). It will be easier for me to explain my problem and what I want to do by showing you code, so here goes: Code:
#include <stdio.h>Code:
#include <stdio.h>Thanks, Ben |
Re: Need help running a program inside a program...
Try this
Code:
#include<stdio.h> |
Re: Need help running a program inside a program...
> gcc is confused
Hmm. Try using indentation properly if the problem is that "the compiler" is confused about code blocks. You'll probably find the problem becomes immediately apparent. Code:
#include <stdio.h>No, not really. I counted six. The compiler can handle waaaaaaaaay more than that before it starts to get confused. > /* a command to run ./game would appear here, if there is such a thing */ > So is that possible? And if so, how? Yes, but that won't solve your problem. Looking a little closer: Code:
char play;Code:
scanf ( "% ", &play ); |
Re: Need help running a program inside a program...
:( /me begs for mercy.
I had more indentation in kate, but when I copied here it went away... :(. I probably did mean %c because I wasn't sure what went after the % in this scenario so I left it blank until I found out. Anyway, thanks for your replies, I think I sorted it now =]. Ben |
| All times are GMT +5.5. The time now is 03:18. |