| Getting Started with C++; what do i use to start c++? | |
|---|---|
| Topic Started: Mar 28 2009, 04:30 PM (891 Views) | |
| MrJoeyUK | Mar 29 2009, 11:48 AM Post #11 |
|
Good to see you're jumping right into the deep end and writing code yourself.. I see too many people copy and pasting code into a compiler and claiming to be good programmers. I also use Dev C++, can't go wrong with it.. I'd also reccomend buying a good c++ book somewhere, online tutorials may be good but from my experience of using them (I'm also quite new to programming) they tend to be quite limited and often don't explain the code it is telling you to use very well, it just tells you the code.. sorta like learning to put 2 ounces of sugar into a cake but not learning why you do it, if you understand.
|
![]() |
|
| Samael88 | Mar 29 2009, 11:56 AM Post #12 |
|
Okay, here is what you wrote. And here is what is wrong with it: 1. It should be "iostream" not "isostream" And it might need to be "iostream.h" but I'm not sure.2. "count" should be "cout". Another pointer is this: You don't need the brackets() in "return 0;" It is just as good as I wrote it here, it's more if you are returning a complex math-thing or something like this: "return(8*(9+10));". There is one more thing. If you write it like that you won't be able to see the result unless you have a really, really slow comp, or you are using dos. When I work with text-based stuff I do one of these:
Just to get it to stop there for a while so that one can see the result of what one is doing getch() is a function that get's a char, which means a single letter. Or any other tangent for that matter. cin>>a; is a line that tells the program to wait untill it gets an input for a, in this case an integer(whole number, no decimals). I hope that helps
|
![]() |
|
| SheWasAlmost18 | Mar 29 2009, 01:33 PM Post #13 |
|
yeah i wanted to buy a book yesterday but it cost 25 dollars and i had like 9 =( and yeah books are indeed better - yeah i tried your code samuel but i always get 1 error in the compile log it tells me this Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\hello\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\hello\Makefile.win" all make.exe: Circular Untitled1 <- Untitled1.o dependency dropped. g++.exe -c Untitled1 -o Untitled1.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" g++.exe: Untitled1: linker input file unused because linking not done g++.exe Untitled1.o -o "Hello World.exe" -L"C:/Dev-Cpp/lib" g++.exe: Untitled1.o: No such file or directory g++.exe: no input files make.exe: *** ["Hello] Error 1 Execution terminated but i dont understand and it says i have 1 error Edited by SheWasAlmost18, Mar 29 2009, 01:37 PM.
|
| We are made kind by being kind | |
![]() |
|
| Samael88 | Mar 29 2009, 03:49 PM Post #14 |
|
Have you moved your dev-c++ after installation? Have you saved the cpp file? Are you using a project file or just a plain cpp file? |
![]() |
|
| Admireable | Mar 29 2009, 06:06 PM Post #15 |
|
Hi guys am new to this forum but anyways read a few topics abt c programming ... and i am shocked to see no one talking about Standard C only c++ :S anyways i would prefer Devc++ compiler also for windows platform ! Dont see Your Future in Propietary Products ! The Best Things in da World Are Always Free
|
| There Are 10 Types Of People In This World, One´s Who Understand Binary and Other´s Who Dont ! | |
![]() |
|
| SheWasAlmost18 | Mar 29 2009, 08:58 PM Post #16 |
|
@samuel no i didnt move the file and how do i find out if i saved my cpp file |
| We are made kind by being kind | |
![]() |
|
| Samael88 | Mar 30 2009, 04:30 AM Post #17 |
|
did you save the file before you clicked compile and run? |
![]() |
|
| SheWasAlmost18 | Mar 30 2009, 04:58 PM Post #18 |
|
hey I'm trying to make it display I am talking to you but when i compile it I get 4 errors can someone help? Edited by SheWasAlmost18, Mar 30 2009, 06:31 PM.
|
| We are made kind by being kind | |
![]() |
|
| Cosmic_AC | Mar 31 2009, 05:09 AM Post #19 |
|
Just use #include <iostream> instead of #include <iostream.h> Also, you forgot using namespace std; or just std::cout << mystring; And again, when you run it, it'll close immediately unless you ask for input with something like cin.get() Edited by Cosmic_AC, Mar 31 2009, 05:10 AM.
|
| ++++++++++[>+++++++>+++++++++++<<-]>---.>+.++++.------.----.------.<<++++[>>+++++++<<-]>>.<---.+++. | |
![]() |
|
| Samael88 | Mar 31 2009, 06:09 AM Post #20 |
|
the only thing you need to do is change string into std::string, that will make it work. and if you want to see your result as the previous poster said, you need to put in the cin.get(); right before the return. like this:
Here is how I got it working. Press retur/enter on your keyboard to get it to quit. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Application Programming Support · Next Topic » |






8:06 PM Jun 19