C++

+1 Robert Summers · August 3, 2014
Error displaying: Returning a value from constructor.

I am following Buckys 15th tutorial in Buckys C++ Programming Tutorials, Placing Classes in Separate Files. 
Please Help, thanks in return. 

main.cpp
#include <iostream>
#include "Burrito.h"
using namespace std;

int main()
{
    Burrito ro;
    return 0;
}


Burrito.h


#ifndef BURRITO_H
#define BURRITO_H


class Burrito
{
    public:
        Burrito();

};

#endif // BURRITO_H


Burrito.cpp

#include "Burrito.h"
#include <iostream>

using namespace std;

Burrito::Burrito()
{
    cout << "i am a orange" << endl;
}


Post a Reply

Replies

Oldest  Newest  Rating
0 Bucky Roberts · August 3, 2014
Better off using just Visual Studio Express, people get this problem all the time with Codeblocks.
0 waliul hasnat · August 3, 2014
you should declare a return type when you are declaring the member function in the class and then write the same return type like this:   type Burrito::Burrito()
0 Bucky Roberts · August 3, 2014
It's the constructor, it doesn't need a return type.
  • 1

C++

109,329 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator