Alice Community

Alice Community (
-   The Lounge (
-   -   I'm learning C++!!! (

TauTrumpsPi 06-02-2011 05:25 PM

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*:)

jediaction 06-02-2011 05:28 PM

I am starting soon. I am excited to

dubastot 06-02-2011 05:32 PM

C++ is pretty easy compared to other languages. The hardest language is learning 3 of them all at once.

jediaction 06-02-2011 05:35 PM

I heard C# was hard. Now that I think of it, I am learning C#, not C++. Sorry, my mistake

sfunk 06-02-2011 05:56 PM

good job guys, I hope to take some kind of class for this eventually

legolizard 06-02-2011 08:00 PM

#include <iostream>
#include <conio.h>

int main()
std::cout<<"Cool man!"<<std::endl;

return 0;

sfunk 06-02-2011 08:38 PM

[QUOTE=legolizard;36817]#include <iostream>
#include <conio.h>

int main()
std::cout<<"Cool man!"<<std::endl;

return 0;

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

legolizard 06-02-2011 10:22 PM

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.

sfunk 06-02-2011 10:54 PM

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

David B 06-03-2011 09:20 PM

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 05:02 PM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.