GNU C++ code/concept help needed.
Rohit Kumar <rohitsz2-/[email protected]> Sun, 18 Sep 2005 13:06:59 -0700 (PDT)
| Newsgroups | gmane.user-groups.linux.delhi.devel |
|---|---|
| Message-ID | <[email protected]> |
Greetings there, need help with c++ code(actually 2). First code is here:http://www.geocities.com/rohitsz2/Student.txt Problem: unable to access a char pointer. can not understand why. just a guess: is initialization needed, if yes how to set size for an run-time defined string length pointer? Second code is here: http://www.geocities.com/rohitsz2/ProfileCustomized.txt Problem: Unable to intialize a default argument constructor that has char pointer. so am unable to create objects in main(indicated in the main function in the code) got *strange* error for second code at compilation... --------------------ERROR(second code)---------------- [rohitsz@localhost Constructor]$ g++ ProfileCustomized.cpp ProfileCustomized.cpp: In function `int main()': ProfileCustomized.cpp:339: error: jump to case label ProfileCustomized.cpp:335: error: crosses initialization of `ProfileCustomized pcn' ProfileCustomized.cpp:349: error: jump to case label ProfileCustomized.cpp:344: error: crosses initialization of `ProfileCustomized pcnp' ProfileCustomized.cpp:335: error: crosses initialization of `ProfileCustomized pcn' ProfileCustomized.cpp:363: error: jump to case label ProfileCustomized.cpp:357: error: crosses initialization of `ProfileCustomized pcnpr' ProfileCustomized.cpp:344: error: crosses initialization of `ProfileCustomized pcnp' ProfileCustomized.cpp:335: error: crosses initialization of `ProfileCustomized pcn' ProfileCustomized.cpp:366: error: jump to case label ProfileCustomized.cpp:357: error: crosses initialization of `ProfileCustomized pcnpr' ProfileCustomized.cpp:344: error: crosses initialization of `ProfileCustomized pcnp' ProfileCustomized.cpp:335: error: crosses initialization of `ProfileCustomized pcn' [rohitsz@localhost Constructor]$ --------------------ERROR(second code)---------------- PS: sorry for not including line-numbers in the code-links, but the error place are commented(//). kindly help, thanks, rohit. NAMASTE, i honour the spirit in you which is also in me. ``````````````````````````````````````````````````````` http://www.geocities.com/rohitsz2 = __________________________________ = Yahoo! Mail - PC Magazine Editors' Choice 2005 = http://mail.yahoo.com