I can't make programs

Hi everybody, i am a beginner, and programms which i write, then i type "compile" then "run" it says 1 error .

All programs which i write i get it from the internet, i don't think they are wrong .

In youtube, they works , but to me not.

Could anyone tell me which version of C++ you use.... Please contact me in :
[email protected]
It sounds like your getting confused with how you create c++ programs. You need to use a compiler to compile the code you have written into a workable .exe. Post what you have done and we'll help you get ont he right path because it sounds like you're just typing commands into cmd.
ok, listen. Download Dev-C++ (http://www.bloodshed.net/devcpp.html) (I think that's a good compiler). install if needed, I don't know, I use another compiler. Then, open Dev-C++ and open a new file. write in the "main.cpp" this code:

1
2
3
4
5
6
7
#include <iostream>
using namespace std;
int main() { 
cout << "Hello!";
cin.get();
return 0;
}


It should work like that.
Download Dev-C++ [...] (I think that's a good compiler)

That's not a compiler but and IDE and it isn't even good
http://www.cplusplus.com/forum/articles/7263/
Hy!
Is the source code containing:
#include<conio.h>

clrscr()

getch()

void main()

#include<iostream.h>
?
Then you should change the book you are using.It's an old book.
Here are some pointers:
- don't use #include<conio.h> , it's not from the C++ standard library
- clrscr() and getch() are from conio.h so they are not available as well.Don't use them.
- always include the header files from the standard C++ library, such as iostream, string, etc.
without the .h extension.So the right way to do it is:
#include<iostream> not iostream.h
- main is always an integer function, so the right way to do it is:
int main()
- if the compiler tells you it doesn't know what cout is, or other keywords that are
clearly from the C++ library, then either put std::before those keywords everytime,
or just put using namespace std; before the main() function.
Last edited on
Topic archived. No new replies allowed.