| | |
help :S
Thread Solved
![]() |
•
•
Join Date: Nov 2008
Posts: 5
Reputation:
Solved Threads:
0
hey there ,
Im taking C++ courses in my collage (so ım a newbie) and they are teaching programing language a bit different from the examples in this forum.
well this works too, but ı can not understand most of the programs in this forum
is there any place to learn how to write that " cout << ".... ; " thing or something like this
ty for helping this newcommer
/* sorry for my bad english ı hope u could understand what ı meant */
Im taking C++ courses in my collage (so ım a newbie) and they are teaching programing language a bit different from the examples in this forum.
c Syntax (Toggle Plain Text)
#include <stdio.h> int main (void) { int x; int y; int z; int min; printf("enter 3 numbers : "); scanf("%d %d %d", &x,&y,&z); min=x; if (y<x && y<z) y=min; if (z<x && z<y) z=min; printf("min is : ", min); return(0); }
is there any place to learn how to write that " cout << ".... ; " thing or something like this
ty for helping this newcommer

/* sorry for my bad english ı hope u could understand what ı meant */
Last edited by Ancient Dragon; Nov 20th, 2008 at 8:22 pm.
Reason: add code tags
That is C code, not C++. Are you sure you are in a c++ class?
for a fstream tutorial click here.
cout is quite easy to learn. First you have to include <iostream> header file -- it does not have a .h extension. Then declare the std namespace.
for a fstream tutorial click here.
cout is quite easy to learn. First you have to include <iostream> header file -- it does not have a .h extension. Then declare the std namespace.
C++ Syntax (Toggle Plain Text)
#include <iostream> using std::cout; int main() { cout << "Hello World\n"; }
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
If you want to use cout and cin you'll have to include <iostream> and use namespace std.
A sample program is something like this:
It's really not that hard, a good site would be: http://www.java2s.com/Tutorial/Cpp/0...0040__cout.htm
By the way, why give void as an argument to main?
Hope this helps, if you have any questions just post them ^^
EDIT: bah, Ancient Dragon beat me to it
A sample program is something like this:
cpp Syntax (Toggle Plain Text)
#include <iostream> int main() { int x, y, z, min; // Don't forget you can declare multiple variables of the same type on the same line std::cout<<"Enter 3 numbers: "; std::cin>> x >> y >> z; // When entering the three numbers you have to leave spaces between them here min = x; if (y<x && y<z) y=min; if (z<x && z<y) z=min; std::cout<<"min is : " << min << std::endl; // This prints text with the first insertion operator '<<', and a variable with the second // I added an endline for the beauty of it system("pause"); // Pauses the application return 0; }
It's really not that hard, a good site would be: http://www.java2s.com/Tutorial/Cpp/0...0040__cout.htm
By the way, why give void as an argument to main?
Hope this helps, if you have any questions just post them ^^
EDIT: bah, Ancient Dragon beat me to it
Last edited by brechtjah; Nov 20th, 2008 at 8:29 pm.
•
•
Join Date: Nov 2008
Posts: 5
Reputation:
Solved Threads:
0
ty for your replies.
well, i am taking introduction to programing class and they are telling us that " we are teaching you c++" but im not so sure about this now
i have no clue about this they just tought us to do that this way and when i ask assistants about it, they just dont explain us clearly .
ty again
•
•
•
•
That is C code, not C++. Are you sure you are in a c++ class?
i have no clue about this they just tought us to do that this way and when i ask assistants about it, they just dont explain us clearly .
ty again
void main(). C and C++ standards require main() to return an int.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Other Threads in the C++ Forum
- Previous Thread: Reading a file. Copying over to other file. Renaming. Renaming = -1?
- Next Thread: Homework Function Compile Errors
| Thread Tools | Search this Thread |
api array auto based beginner binary bitmap c++ c/c++ calculator challenge char class classes code coding compile console conversion count createcopyofanyfileinc delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption equation error file forms fstream function functions game garbage givemetehcodez graph gui hmenu homeworkhelp homeworkhelper iamthwee ifstream input insert int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node output parameter pointer primenumbersinrange problem program programming project python random read recursion reference rpg sockets string strings temperature template test text text-file tivoli tree url variable vector video win32 windows winsock wordfrequency wxwidgets






