Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
VC++ 6 problem with friend function
Name: carl2003 Date: February 19, 2003 at 22:11:03 Pacific OS: win XP CPU/Ram: 256
Comment:
Hi there, I currently started using vc++, the problem with VC++ 6.0 is when i try to access data members by friend function i get a massage.. ""cannot access private member declared in class..." When usind bloodshed , i dont get this message and everything works fine.. What would be the problem with VC++? I appreciate any help.. Thanks in advance.. Carl.
Name: borelli34 Date: February 19, 2003 at 22:52:26 Pacific
Reply:
Is the friend specifier within the class definition or within an inherited instantiation?
borelli34
0
Response Number 2
Name: carl2003 Date: February 19, 2003 at 23:41:05 Pacific
Reply:
Its within the class definittion.. I just made a little reasearch and i found out that VC++ has a liitle bug when using namespace std; with friend functions.. Now i am trying to download the upgrate package and hopefully i will make it work.. Here is a link with a description about this "bug".. http://www.cs.virginia.edu/~csadmin/pc/pclabs/vc_faq/
just screw down and you will see.. also information on upgrading... Thanks ..
0
Response Number 3
Name: Mathew Joy Date: February 19, 2003 at 23:49:24 Pacific
Reply:
Dear Carl, Normally u won't get such an error. The friend keyword must me specified at the delaration inside the class, not at the definition. And also note that the friend function cannot access the private members of the base class if it is a friend of the derived class.
0
Response Number 4
Name: carl2003 Date: February 20, 2003 at 00:18:22 Pacific
Reply:
Ok ..maibe i was wrong when i said deffiniton...My program actually is quite simpe-i dont have derived classes..Its a just a simple class with three priavet data members-gpa,id,name..some functions and a a few friend functions as public within the class. I compiled with bloodshed and it wordked , but with VC++ it didnt work and i kept getting that error message that i dont have permission to access the data members.. But after i downloaded and upgraded from the link which i specified above it seems like it works.. I am pretty sure something was wrong with the microsoft compieler... But thanks to all of you..:-) Carl
Summary: *We celebrate SN's first PHP answer* This is a well-documented problem with strtotime() on windows: "Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan...
Summary: If i try to build an mfc based app (vc++ 6)to access (using dialogs, forms ecc.) the myslq-databases trough the mysql++ API i get strange linker errors! (...symbol already exists... not found...and so...
Summary: I am using VC++6 for the PC. I went to TOOLS|Customization and began altering menus items around. Under the menu BUILD I altered the keyboard shortcut for both the DEBUG->GO (from F5 to CTRL+F5) and...