C++ Error HELP!!!!

  • Thread starter Thread starter Sweetness
  • Start date Start date
S

Sweetness

I am writing a program for class that returns a persons Birthstone,Sign and
Season born in... after they input their Birthday and If I hard code in the
stone it works but if I use this code:

string Stone[13] =
{"Invalid","Garnet","Ameythist","Bloodstone","Diamond","Emerald","Pearl","Ruby","Periodt","Sapphire","Opal","Topaz","Turquoise"};

seeMonth = seeDate.getMonth();

BS = Stone[seeMonth];
I get this error:

Unhandled exception at 0x00421cd6 in Birthday.info.exe: 0xC0000005: Access
violation reading location 0x6679619c.

What does it mean?
 
What are the declarations of seeMonth, seeDate, BS and the function getMonth()?

I don't have c++ at home, but it sounds like getMonth is not returning a
value between 0..12.
 
Goodness...
I've writen a class for Date.... which returns Month Day and Year. It is
Pulled into my class Birthdate, which holds this code that contains the
error.
--
Sirena


Family Tree Mike said:
What are the declarations of seeMonth, seeDate, BS and the function getMonth()?

I don't have c++ at home, but it sounds like getMonth is not returning a
value between 0..12.

Sweetness said:
I am writing a program for class that returns a persons Birthstone,Sign and
Season born in... after they input their Birthday and If I hard code in the
stone it works but if I use this code:

string Stone[13] =
{"Invalid","Garnet","Ameythist","Bloodstone","Diamond","Emerald","Pearl","Ruby","Periodt","Sapphire","Opal","Topaz","Turquoise"};

seeMonth = seeDate.getMonth();

BS = Stone[seeMonth];
I get this error:

Unhandled exception at 0x00421cd6 in Birthday.info.exe: 0xC0000005: Access
violation reading location 0x6679619c.

What does it mean?
 
All I was asking for was to confirm what data type all the objects
in the code are declared.

I would set a breakpoint at the line "BS = Stone[seeMonth];" and
look at the value of seeMonth. The value should be 0..12.

Sweetness said:
Goodness...
I've writen a class for Date.... which returns Month Day and Year. It is
Pulled into my class Birthdate, which holds this code that contains the
error.
--
Sirena


Family Tree Mike said:
What are the declarations of seeMonth, seeDate, BS and the function getMonth()?

I don't have c++ at home, but it sounds like getMonth is not returning a
value between 0..12.

Sweetness said:
I am writing a program for class that returns a persons Birthstone,Sign and
Season born in... after they input their Birthday and If I hard code in the
stone it works but if I use this code:

string Stone[13] =
{"Invalid","Garnet","Ameythist","Bloodstone","Diamond","Emerald","Pearl","Ruby","Periodt","Sapphire","Opal","Topaz","Turquoise"};

seeMonth = seeDate.getMonth();

BS = Stone[seeMonth];
I get this error:

Unhandled exception at 0x00421cd6 in Birthday.info.exe: 0xC0000005: Access
violation reading location 0x6679619c.

What does it mean?
 
Back
Top