c++ - Code::Blocks - Linux - prints "Hello World" even though it isn't in the "main.cpp" file -
i have started few projects me learn c++, creating program allows user enter grade score /100, code follows:
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; int main (gradescore) { int gradescore cout << "enter grade score out of 100" cin >> gradescore if (gradescore == 100) { cout << "well done! have achieved perfect score!.." { } i tried compiling make sure working far, however, opens terminal , prints
hello world! process returned 0 (0x0) execution time : 0.013 s press enter continue. i'm not sure it, there's in project contains string "hello world" anywhere. please me? want able carry on learning without , hinderance this.
i'm using code::blocks 13.12 rev 9501 (2013-12-25 18:25:45) gcc 4.8.2 linux/unicode - 32 bit (not sure if helpful)
thanks guys.
i'd thank advice , help, i'm sure it's frustrating seeing questions time off noobs.
i have solved problem , turns out solution stupidly easy: deleted project, made new one, opened main.cpp file , found cheeky little bugger sitting on file:
#include <iostream> using namespace std; int main() { cout << "hello world!" <<endl; } i deleted , corrected original program this:
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main() { int gradescore; cout << "input test score out of 100:"; cin >> gradescore; if (gradescore == 100) { cout << "congratulations! achieved perfect score" << endl; { } again, thank patience guys! promise i'm trying hahaha!
Comments
Post a Comment