cout<< "please enter 3 numbers!";<< endl;
cout<< "please enter 3 numbers!";<< endl;
Part of learning to program is learning how to debug. They go hand in hand
Thanks for those answers they worked!!!
And also I installed dev-c++ (bloodshed) compiler but couldn't run the file after compiling it successfully. I mean if I click on run no actions take place.
what to do to fix that?
Last edited by limac; December 4th, 2007 at 01:52 AM.
Think carefully before just copying and pasting the commands your are advised into your terminal and clicking Enter, for more information about which ones not to use see this: http://ubuntuforums.org/announcement.php?f=73
Are you sure nothing happens?
In dev-c++ the console window closes as soon as the program finished execution (main returns). Add this at the end (but before the return of course) so that the window will stay open:
Code:int test; cin >> test;
Intel E6300 / MSI P4M890M / 2GB DDR2 677 / 80GB + 1TB SATA2 / GeForce 6200TC / DL DVD+-RW / Dell 24" U2410
Write a getch() or a cin>> statement towards the end of your program so that the output window remains there till you can view it
The old saying used to be you can learn a new programming language in 3 months but you need 6 months to learn C.
C is very simple at certain levels. Because of it low use of reserved words and simplistic syntax you can get to grips with some of it relative easily, however to be really good does take a bit longer.
I have seen good code and I have seen awful code.
Good code would consist of small functions, good flow control, tight lops etc. |I used to work on the basis that if a function went over more than two screens it was probably getting too big.
I have seen some function stretching over a 30 page listing. It is almost impossible to see how the code is controlled and is a nightmare to debug.
So maybe the language is simple but what you do with is may not be. Ultimately you pays your money and take your choice.
Mick 'n Keef rock, Chas beats time and Ronnie is the new boy
Registered as user 466848 with the Linux Counter. Registered Ubuntu User 22858. Our company website or our new venture
Learning syntax of a language is one thing. Learning idiomatic usage of language, libraries and data structures is different - and takes substantially more time.
Catch with learning C vs C++ is: idioms are different, valid C is bad C++ and vice versa.
Disclosure: I am not C/C++ expert but this is what real experts repeated over and over in previous discussions.
BAsically they are used to implement different programming paradigms-
My blog | Arch User | Linux user #439142 | Ubuntu user #10974
"God is real unless you declare it as integer"
Edit: Ignore, already been answered aboveCode:cout<< "please enter 3 numbers!";<< endl;
Today we have 15 minutes of fame, tomorrow 15 minutes of anonymity.
My Blog | Veza - Opensource TinyURL clone with sensible URLs
Bookmarks