Programming

you can use printf("Press Any Key to Continue...");getch(); to act like a system pause. basically you want to avoid going to the shell whenever possible because you can't always predict how it will behave.
aaah, ok, thanks for that cromewell, thanks

dragon2309 did you get that compiler? because I really wanna do some programming in C and I really got to do it because I can't find an editor and compiler. I was gonna install Linux but I wanna wait until I've made my new computer and it might take a while.
Hi, i use Dev C++, by a company called BloodShed, google around a bit and youll find it, its fantastic and really REALLy simple. built in comilereditor and debugger. FANTASTIC.
 
dragon2309 said:
the return 0 part, is that to hold the cmd applet open when its finished, because it closes automatically. I know this is because its how indows habdles it, and i know theres a simple way to make it stay open indefinately, do you know how to do that?

the return 0 lets the operating system know that the program ran succesfully and returns control the operating system. some people also use return exit_success

cheers cromewell, your code works and everything, is there any reason why you spaced it all out or anything?

spacing allows greater readability of code. programs are ment to be modify so you may also utilize comments so if you pulled the program out a year later you can still understand it. computer science is a real pain in the arse. at my school there is basically one actual program class. the rest of the classes are more on writing efficient programs.
 
have to use shitty Vim, its complete crap, its basically notpad that can execute cammands, it doesnt compile easily and it has no colour coded text thigns like Dev C++, its really poor, runs on Debian.
 
Right-click any *.EXE file and select PROPERTIES.
Fill in the options you want. (Un-check the CLOSE ON EXIT option).
Click OK.
Run your program
 
Back
Top