I'm learning C++!!!
Well, I am officially taking an online class in C++, which is a prerequisite in the college I am taking the class through for Java. This is my first real programming language, and already Alice has helped me understand many of the concepts. Thank you Alice! *Feels accomplished*:)
|
I am starting soon. I am excited to
|
C++ is pretty easy compared to other languages. The hardest language is learning 3 of them all at once.
|
I heard C# was hard. Now that I think of it, I am learning C#, not C++. Sorry, my mistake
|
good job guys, I hope to take some kind of class for this eventually
|
#include <iostream>
#include <conio.h> int main() { std::cout<<"Cool man!"<<std::endl; getch(); return 0; } |
[QUOTE=legolizard;36817]#include <iostream>
#include <conio.h> int main() { std::cout<<"Cool man!"<<std::endl; getch(); return 0; }[/QUOTE] so you have to use a number variable to implement a string? thats what it looks like what that is saying but im not sure :o |
Not quite.Here is basically what is happening:
The first two lines are header files the first being input and output(iostream) and the other(conio.h) which I use to close the program. Then we have the main()aka the main [B]function[/B], basically the engine of the program. Within the main function we have three lines of code. The first being an output were std::cout<< tells the compiler to use the standard namespace which is located in the iostream header file, to display the string, and then to make a new line(std::endl=end line). Next we have getch() which pretty much closes the program, and finally we have return 0. Since we have made a [B][I]function[/I][/B] not a variable we must return something(unless you make it a void) in this case 0. When the program is completed and was a success 0 is returned back to the main(), thus ending the program.:) So in short we are declaring a function not a variable. |
ahh I see, thanks for clearing that up :D I knwo a little bit of java so when I saw int main() I thought it was telling the program to recognize the next line of code as an interger XD since you use int or double in java
|
I'm Learning C++ Too!
In addition to the one week course I will be taking on C++ this summer, I am currently reading, "Beginning Programming with C++ For Dummies." (Which is why I haven't been active on the forums for some time. The time I used to set aside for posting has been replaced, but don't worry. I shall return.)
|
All times are GMT -5. The time now is 01:08 AM. |
Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.