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






