| | |
initializer list err
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2007
Posts: 21
Reputation:
Solved Threads: 1
C++ Syntax (Toggle Plain Text)
class base { private: int i; void seti( int i_temp ) // :i(i_temp) ->Initializer List not working { i = i_temp; } public: base() { } base( int t ):seti( t ) { } };
That is the error i get for the code above it. could someone please tell me where im err-ing?
Last edited by desijays; May 25th, 2007 at 4:08 am.
•
•
Join Date: Dec 2006
Posts: 1,089
Reputation:
Solved Threads: 164
C++ Syntax (Toggle Plain Text)
// ... base( int t ) : i(t) {} // initialize member i with t // ...
•
•
Join Date: Mar 2007
Posts: 21
Reputation:
Solved Threads: 1
•
•
•
•
C++ Syntax (Toggle Plain Text)
// ... base( int t ) : i(t) {} // initialize member i with t // ...
C++ Syntax (Toggle Plain Text)
base( int t ): seti( t ) { }
Afterall im jus calling a private function to initialize 'i'.
Last edited by desijays; May 25th, 2007 at 7:44 am.
![]() |
Similar Threads
- (reformatted) How to return Multi-Dimensional Arrays (C++)
- C++ Performance Tips (C++)
- please explain initializer list. (C++)
- 6 Line class -> Me pounding head into wall (C)
Other Threads in the C++ Forum
- Previous Thread: I'm sure the answer is painfully obvious but....
- Next Thread: handheld telnet emulation
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg simple sorting string strings template text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






