I want to ask about the tutorials...

Hi,
My name is Dilyan Yosifov. I want to ask, can I create a simple tutorial on my site on C++ with the knoledge I gained after your tutorials? Are there any copyrights on this material or not?
Im new to this site and to C++ programing at all so please answer this topic.
Thanks for reading.

P.P. Don't analize my spelling - Im Bulgarian.
I want to ask, can I create a simple tutorial on my site on C++ with the knoledge I gained after your tutorials?


Knowledge in your head is all yours. Do as you wish with it. Nobody can own what is in your mind. Unless your in America :P
Just don't copy the tutorial here exactly, as long as you don't do that you should be fine.
Thanks for the answer, but there's something else on my mind.
What is the C++ equivalent of the INPUT operator in BASIC. I have programmend in Quick BASIC 4 before and know these commands well.
And after that I want to store the result (what the user types) in a varriable.
How can I do that?
Input works a bit different between C++ and BASIC. Here is an example of reading in and then printing out a value:
[code=c++]
#include <iostream>
using namespace std;

int main() {
int x;

cin >> x; // Read value into x
cout << x << endl; // Print x and end the line

return 0;
}
[/code]

You should know that using cin like this will only work if the user input doesn't contain spaces. If it contains spaces, you should use the getline() method. Check out http://www.cplusplus.com/reference/iostream/istream/getline.html for more information on getline() - there is a good example at the bottom.
Last edited on
When I run the program, It lets me type what I want. But where in the code
a value is givven to int x; ?

And what do cout << x << endl; does ?
The line cin >> x; gets input from the user and puts it into the variable x. The line cout << x << endl; sends x and endl to the output. endl is the "end of line" character which moves the output to the next line.

Try checking out the tutorials on this site to learn more about C++. Here is the tutorial for input and output: http://www.cplusplus.com/doc/tutorial/basic_io.html
Thanks,
That was helpful. The tutorial to which you gave me the link is on my way
i. e. Im on the "Varriables" part of the whole tutorial now and "Basic Input/Output" is after "Operators". I'l get on to it.
No need for a reply for now mahlerfive, I'l dig my way out, I gues...
Thanks again.
Topic archived. No new replies allowed.