The program won't running

+1 Putra Adhie · November 5, 2014
please help me,
i have an error message in 15th tutorial "Placing classes in separate files"


And I can't upload some pictures for my post, because there is any error codes "502 Bad Gateway"

so this is just a code.
here's the code :

main.cpp

#include <iostream>
#include "Putra.h"
using namespace std;

int main()
{

    Putra po;
    return 0;
}


putra.h

#ifndef PUTRA_H
#define PUTRA_H


class Putra
{
    public:
        Putra();


};

#endif // PUTRA_H



putra.cpp

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

using namespace std;

Putra :: Putra()
{
    cout << "I am a banana" << endl;
}


if i try to run these programs, i got an error message right on the left of the object "Putra po"
 
please help me where is the error !?


Post a Reply

Replies

Oldest  Newest  Rating
+1 Alf Nohr · November 7, 2014
Ohh okay, but does it  terminate immediately? if so, try to add
system("PAUSE");

at the end of your code.
0 Putra Adhie · November 7, 2014
still the same..
and sometimes if i run the program, no error messages on the program, the program just shut up, and nothings happened...

I used the new code blocks here, there is more any tools than the old one.

i have kinda confused about this, i guess i will be skip for this tutorial.

i'm sorry before if my english language is so bad, because i'm using the google translate
0 Alf Nohr · November 6, 2014
hmm, what's the error message?
0 Putra Adhie · November 6, 2014
I have saving my files with "Putra.h % Putra.cpp"
but the programs is still not working
+1 Alf Nohr · November 5, 2014
Can't really see anything wrong with the code, 
but the reason for the error may be that you're saving your file(s) (the .cpp & .h),
with a lowercase "putra.cpp & putra.h" ,and you try to include it with uppercase "Putra.cpp % Putra.h".

Remember that C++ is a case sensitive language.

If that's not the problem, what error message do you get?
  • 1

C++

107,126 followers
About

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

Links
Moderators
Bucky Roberts Administrator