Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   The Lounge (http://www.alice.org/community/forumdisplay.php?f=4)
-   -   I'm learning C++!!! (http://www.alice.org/community/showthread.php?t=6692)

TauTrumpsPi 06-02-2011 06: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 06:28 PM

I am starting soon. I am excited to

dubastot 06-02-2011 06: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 06: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 06:56 PM

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

legolizard 06-02-2011 09:00 PM

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

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

getch();
return 0;
}

sfunk 06-02-2011 09:38 PM

[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

legolizard 06-02-2011 11: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 11: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 10: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 09:25 PM.

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