C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Im trying to run a code, but I cannot successed.. Posted by neus92 on 5 Nov 2012 at 10:22 AM
Hello guys.
I just started to study C language, and the first thing I have done, was to write a simple C code on Microsoft Visual C++..
I just copy-pasted a simply code from "Wiki", compile it, and run.
The code just calculated some simple things, like avrage of some grades and etc.. unfortunatly, when I enter some values to the program, and trying to get a result, the program just closing itself(not the Microsoft visual c++, the C file that I have written..)
so I cannot see the result(in this case, I cant see the value of the avrage of grades..) the program is just writing this statement:"[3440] sucka.exe: Native' has exited with code 0 (0x0)."
someone can help me please?:\
Report
Re: Im trying to run a code, but I cannot successed.. Posted by Pelle-48 on 5 Nov 2012 at 11:17 PM
Normally if you are testing a simple program in windows it will close very fast in the end. You have two alternatives:
Run the exe-file in a DOS box or add some kind of input in the end of your program like:
(this is c)
printf("write a single letter \n");
letter = getchar();
putchar(letter);

You need #include <stdio.h> in the beginning for c
Report
Re: Im trying to run a code, but I cannot successed.. Posted by neus92 on 6 Nov 2012 at 1:05 AM
still the same.. its just closing it..

Report
Re: Im trying to run a code, but I cannot successed.. Posted by Pelle-48 on 6 Nov 2012 at 6:33 AM
On rosettacode.org you have a huge amount of test programs. Try something simple like A+B and see if it works with your compiler!



 

Recent Jobs