Tip:
Highlight text to annotate it
X
Hello everyone, this is my first tutorial and I'm going to show you how to input
And then add it into another output line
Um I assume that you all ready have have eh
Have a project on the line and a new project working
Now let's write #include
Our input / output library
It's a must if you want to output or input text
Now, let's add using namespace std; with semi-colon
Pretty much eh our standard library for std
Um let's skip another line and add int main()
With left and right braces, lets skip a line again
Here you wanna add a left curly bracket
Lets skip a line and I'll just tab it to make it more neat
And now lets start a coding our main function
First your going to add a string
So lets type the string, you could name this of...hmph
You could name this a, x or y any simple character
Cause really you don't wanna have like a big name
I don't know if works but I don't do that
I just...don't do that
Ok, so I named the string x, add a semi-colon again or else you'll get an error
Lets go on the next line
Now lets cout, cout is the output
Now do a space and then two left arrow brackets
And do a space again, and add a quatation
Now whatever your writting here will be...pretty much will be displayed on the screen
Lets say I'm gonna write "what is your name" colon, space
Quotation, and semi-colon or else this won't work
And skip a line
Oh I didn't mean to skip the line, just go in the next line
Er..here, this is going to be may be something that nobody really knows but..
Here's getline, oops not getlion? "getline"
This gets the entire line, well I'm not done writtin the code yet
Now add a left brace and then you put cin comma x right brace semi-colon
Now, lets take about what this thing does
Pretty much what this statment does
It grabs that your input just like this when you execute the program
And this will keep in memory for the next line
well, lets do that now
Next line
Lets output another text, cout, two left arrow brackets
Space, quotation and for an example lets say "Your name is " colon
Well you don't have too, actually lets not do that
Just do a space, two left arr-- oh I made another mistake haha
I'm making fun of myself here
You want to end this with a space and quotation
Then two left arrow brackets, then you add x, which pretty much
the x is the string here
And here when you write an output right here
X is stored here and then in the line its stored here
So anyway, lets do another space and two left arrow brackets again
And then you'd wanna write endl semi-colon
endl is pretty much too end a line
Always remember to add a semi-colon on this or else it's just not gonna work
Now lets get on the next line
Actually lets skip this line, so on the next line
And ah...here's something to talk about
system("pause"); with a semi-colon as well
Ok
This function here is actually a CMD function, which is in Command Prompt to be more precise
Well here is a neat thing, this works in a c++ compiler or may be other compilers I don't know I never tried it out
But this is an excellent way to pause your screen
Instead of having to compile, execute a program and then just shuts right on you instantly
Well this will halt it, will not let the program end without you having to prompt any key in the keyboard
So, really handy to have around
This is pretty much what I call temporary since when you get deeper into c++
This will be completely useless
But I mean very deeply into c++ before the basics
Ok where done with this, lets go to the next line
Now lets add return ah ( Complete Rubbish ) whatever I'm saying?
return 0; semi-colon
Now this is pretty much like saying
We're telling the compiler: Ok, we returned everything, everything went well, um no problems
Pretty much add that, I mean his gonna be more happy to see you write that for him haha
And now, next line back space it just to make it more neat
Then you might add a right curly bracket
Too end the program
So this concludes this, about writting down the code and now you'd wanna execute it
Now, doesn't show here but on the top of the Dev c++ compiler
There's an Execute, then you could just go to compile and run
which is compiling now
Eh I all ready saved this that's something so that's why I didn't have to save it as a name
But this is how it looks like
What is your name?
Um how 'bout I type eh?
Gury Bandit
Your name is gury bandit
Now you see here?
Where it says press any key to continue...
That's the system pause
Right in this, it's waiting you to prompt a key so...I don't know?
Hit space bar anything, I'm gonna go with the space bar
So, anyways
Well this..concludes my tutorial
Hope this was helpful and thanks for watching.