| | |
static friend function
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
We cannot have static friend function...is it because
1.since static member functions can access only static data members...whereas friend function can access all the members.
2.friend function also require an object to access the members...wheeras static member functions can not.
3.One more thing....since friend functions are non-member functions....and static functions are member functions
Am i right.....if there is an error..plz correct....or a better or different reason ...the plz add
1.since static member functions can access only static data members...whereas friend function can access all the members.
2.friend function also require an object to access the members...wheeras static member functions can not.
3.One more thing....since friend functions are non-member functions....and static functions are member functions
Am i right.....if there is an error..plz correct....or a better or different reason ...the plz add
•
•
Join Date: Jul 2005
Posts: 164
Reputation:
Solved Threads: 5
C Syntax (Toggle Plain Text)
static int func(); // proto for a static func class AClass { friend int func(); // can be a friend and retains its static linkage friend int anotherfunc(); // assumed to have external linkage };
![]() |
Similar Threads
- friend function not compiling (C)
- What is Static Friend function (C)
- Change form's cursor in a static member function (C)
- Practical application of static member function (C++)
Other Threads in the C Forum
- Previous Thread: print out problem
- Next Thread: RC4 project
| Thread Tools | Search this Thread |
* ansi append array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copyimagefile copypdffile creafecopyofanytypeoffileinc createprocess() database dynamic execv fflush fgets file floatingpointvalidation fork forloop function getlogicaldrivestrin givemetehcodez grade gtkwinlinux histogram homework i/o ide inches include infiniteloop initialization input interest intmain() iso keyboard km license linked linkedlist linux list looping lowest matrix microsoft multi mysql oddnumber open opendocumentformat openwebfoundation overwrite pdf pointer pointers posix power program programming pyramidusingturboccodes radix read recursion recv recvblocked reversing scheduling segmentationfault send sequential single socket socketprogramming stack standard strchr string suggestions test testautomation testing threads turboc unix urboc user variable whythiscodecausesegmentationfault win32api windowsapi





