Constructor problem

Is there a problem with the code or may it just be the IDE?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  #include <iostream>
#include <string>


using namespace std;

class Penanito
{
   public:
    Penanito(string z)
    {
        setName(z);
    }

    void setName(string x)
    {
        name = x;
    }
    string getName()
    {
        return name;
    }
private:
    string name;

};

int main ( )
{
    Penanito Penanito1("Mr Spickles");
    cout << Penanito1.getName();
    return 0;
}


Its a simple code that is supposed to print out 'Mr Spickles' by accessing a private class member through a public class accessed through a constructor...but i can't seem to find the problem, I'm using xcode for mac and in output it displays "(llbd), is it an Xcode problem or was there a problem with the code :s I couldn't find it eitherways.
That code should compile and run as you expected it to.
What exactly is Xcode spitting out?
(llbd) thats it, problaby just Xcode problem, thanks though :)
Topic archived. No new replies allowed.