Thread: Moving on
View Single Post
Senior Member
Nighthawk0973's Avatar
Status: Offline
Posts: 240
Join Date: May 2011
Location: In front of my computer.
Default 08-08-2011, 04: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 ( 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

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!
Reply With Quote