| | |
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
Views: 2424 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o inches infiniteloop initialization interest kilometer km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape socketprograming spoonfeeding stack standard strchr string strings structures student suggestions system systemcall test testautomation unix user voidmain() wab win32 win32api windows.h





