Alice Community

Alice Community (
-   Questions and Comments (
-   -   Moving on (

legolizard 08-08-2011 04:37 PM

Only syntax errors. Firstly it is endl with an 'l' not end1 with a '1.' Secondly you forgot to use the insertion operators for ever endl;

For example you did:

[CODE]cout<<"Hello we are about to learn about the functions" end1;[/CODE]

But it should be:

[CODE]cout << "Hello we are about to learn about the functions" << endl;[/CODE]

Nighthawk0973 08-08-2011 05:00 PM

it seems like the book your using isn't using the same compiler as you are. I started with dev-C++ and I have deinstalled it. I prefer Code::Blocks ([url][/url]) but I have MSVC++ for when I learn more about GUIs and want to use them more easily. MSVC++ allows you to drag and drop buttons allowing me to create a web browser before I even knew what 'cout' ment :D

I recommend 'Buckys C++ Programming Tutorials' it's a series on youtube. I'm still learning it today. It utilizes the same compiler Code::Blocks has. There's also a tutorial series that hte same guy made called 'C++ Programming Tutorials' and it utilizes Dev C++ but isn't as good. If you want a book on Dev-C++ get C++ For Dummies, all in one desk reference. It has 7 C++ books in one ans will teach you what you will need ot know. Example: Networking!!!!

I like Code::Blocks best because it uses an Eclipse style of programming. So when you make Quotation mark 1, it automatically makes Quotation mark 2 and your cursor gets put inbetween, than you can type the contents of the quote, and lastly you just press the -> key (left arrow) to move outside of the quotation marks and continue codeing.

I think Code::Blocks has the '::' in it because of this: (code made by me just know in Code::Blocks)

Quick Note: This works just ran it! Codeblocks automatically returns 0 if your using the 'int main()' function
#ifndef CODE_H
#define CODE_H

class Code{

Code(); //Code classes constructor
void Blocks(); //void method Blocks

That was a header file called 'Code.h'
#include <iostream>
#include "Code.h"

using namespace std;



void Code::Blocks(){ //NOTICE THE PART AFTER VOID: Code::Blocks

cout << "Get it? Code::Blocks!" << endl; //THIS LINE IS PROBABLY GOING
This is Code.cpp, the reason I did the big comments is so you would see
#include <iostream>
#include "Code.h"

using namespace std;

int main(){

Code Code; //allows us to execute next line without errors
Code.Blocks(); //Calls on the method Blocks from code.cpp
And the result is:

Get it? Code::Blocks!

Process Returned 0 <0x0> execution time : 0.063
Press Any Key To Continue
But the bottom 2 lines are just codeblocks stuff that dissapear when you use more advanced programming I'm sure. It's a fully runnable .exe ready for full distribution now! :D

legolizard 08-08-2011 08:32 PM

Wow. Just wow. Code blocks is actually really cool. I remeber that my teacher once said to me to use it but I don't listen too often.:o The good part though is that it uses a standard compiler for C++ which means that all that I have showed you Belso isn't wholefully useless.:) So yeah download code blocks it is 1000000x better than Dev, only wish I stated using it before.:( Thanks NightHawk, but uh don't you think it is a little early to show him OOP?

belso 08-08-2011 08:58 PM

Ok i will download code blocks and i have realized how different my book is and i will go use a different book

belso 08-09-2011 03:49 PM

Ok i do not get codeblocks at all i am completely stumped.

legolizard 08-09-2011 06:31 PM

Okay what do you mean exactly? Do you mean which version to download ,or how to make a program or what?

Nighthawk0973 08-09-2011 07:29 PM

I hope your not attempting the code that I wrote... that was not ment to be your level at all. I was just saying that I'm pretty sure that's why there's the double colons in the middle of Code and Blocks. (Get it? Code::Blocks! :D)

Anyways here's how you start codeblocks. File->New->Project

inside your project there's a file called 'main.cpp' inside your main.cpp type the following:

#include <iostream>

using namespace std;

int main(){

cout << "Hello World, but in Code::Blocks!" << endl;

This will print out a Code::Blocks hello world. Don't add the return 0; because it already does that with codeblocks.

Yeah. I always strive to find the best IDE. Best Java IDE is Eclipse. Best C++ IDE is Code::Blocks, best VB IDE... I have no clue :D
(Best HTML IDE that I know of is JCreator)

belso 08-09-2011 08:38 PM

Ok i installed it but when i go into where i make a project i dont see the main thing that you were talking about so i cant code anything. Maybe i did install it wrong

legolizard 08-09-2011 09:28 PM

If you look at the left you will see a tab called "projects" make sure you have that tab open and you see something that says "workspace." Make sure you click it and two other things will pop down. Now you should see a + butt0n next to "Source." Click the plus sign and and another file will popup called main.cpp.. Click it and TA DA!

belso 08-10-2011 12:40 PM

Alright i found it and i can do code now but when i made the code the nighthawk did i go to build and run and it dosent do anything

All times are GMT -5. The time now is 07:14 AM.

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