User Profile
Collapse
-
Yes it helped! This issue is resolved thanks a lot!... -
Thanks Folks you two have been helpful.
Aparently, I did not occur to me that the reasons for the errors were because I hadn't recalled the function via class name (eg void Heading:: GetData) I just figured since it was in the public section of the class, there was no need for addressing it like that.. thanks for the foresight Gparnamg.
Banfa thanks for the refered site, I've had it taged on my fav for future use. Your explanations...Leave a comment:
-
I acctually did use the right quotation mark for strings and changed it because I couldn't still id the identifier "companynam e" as being declared. I got errors that they(companynam e & reportname) were undeclared identifiers. So I tried using the char* and changing the quotations, but I still got the same result. The other person who suggested allocating space for memory, got me confused with:
{
companyname = new char[strlen[cname]+1];...Leave a comment:
-
Sorry, I should have said I'm new to C++, and I didn't understand your suggestion. I wasn't even aware there was a command called new char. I can't find that in any of the two C++ books I'm reading, how bout If I use strings in this manner: What seems to be the problem with the default constructor & why is it that the companyname and reportname end up as undeclared.
thanks
class Heading
{
private:
...Leave a comment:
-
Inputting Data which contain spaces.
I tried using string and had problems, and now Im trying char* and I cannot still initialize "ABC Industries" as a default constructor. It appears that spaces between words make char variable uninitialized. How can I avoid this? Pls help. I'm trying to read a set of words that may contain spaces in them.
class Heading
{
private:
char* companyname;
char* reportname;
public:
... -
I tried that already so it builds but the problem is there is something wrong with the input, it doesn't redisplay the entered number. It just shows a 0 even if the number entered is 58.
Thats why I was thinking it was the way I was reading the input so I tried using cin.get...Leave a comment:
-
yeah, u r right but that's for the error c2228 [It should have been a semicolon]
For the error c2664 on line 26 and 33. If I took away the "input" in the cin.get(input), the error would go away but it doesnt yet do what I'd like it to do...Leave a comment:
-
Error C2664, C2228
I'm trying to learn how to set ranges by using classes and I get Error c2664 and C2228 when I build. I saw the question in my practice texrbook and I cant figure out what I'm missing.
It says "ui" should have a class on the left of "ui' but it already does.
Its declared right after the Range. Can you help
...Code:#include <iostream> #include <iomanip> #include <string>
-
Logical Error: Help Pls.
can someone pls tell me why this thing would not calculate my division intergers and show it within my struct. PLS HELP I'M NEW TO C++, AND HAVE SPENT 4 DAYS TRYING TO FIND OUT WHY I CANT DO THIS THING RIGHT. I'M ACCTUALLY TRYING TO FIGURE OUT HOW STRUCTS WORK BUT IT SEEMS LIKE I CANT GET IT TO TOTAL MY INTERGER AND DISPLAY IT WHEN I CALL THEM IN MAIN.
THANKS
...Code:#include <iostream> #include <iomanip>
No activity results to display
Show More
Leave a comment: