help :S
Please support our C++ advertiser: Programming Forums
Thread Solved
![]() |
•
•
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 7: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.
#include <iostream>
using std::cout;
int main()
{
cout << "Hello World\n";
} 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 7:29 pm.
•
•
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
![]() |
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
•
•
•
•
Views: 332 | Replies: 4 | Currently Viewing: 1 (0 members and 1 guests)






Linear Mode