| | |
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 array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






