| | |
Array Initialization
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jan 2007
Posts: 18
Reputation:
Solved Threads: 0
i want to initialize an array(set all elements to 0) . The array is to be used by different functions which r defined outside the class. obviously i cant initialize it in the class. and if i do it in a constructor or main(), it isnt recognised by all the functions outside the class using it.
what do i do ? where do i initialize the array. Please help. this is just the thing holding me back.
what do i do ? where do i initialize the array. Please help. this is just the thing holding me back.
•
•
•
•
i want to initialize an array(set all elements to 0) . The array is to be used by different functions which r defined outside the class. obviously i cant initialize it in the class. and if i do it in a constructor or main(), it isnt recognised by all the functions outside the class using it.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
•
•
Join Date: Feb 2007
Posts: 3
Reputation:
Solved Threads: 0
it shouldn't happen. try
C++ Syntax (Toggle Plain Text)
#include <iostream> int main () { int test [5]={0}; cout<<test[0]; }
![]() |
Similar Threads
- Functions and Array help (C++)
- Help : Pointers to array of class objects . (C++)
- template array initialization (C++)
Other Threads in the C++ Forum
- Previous Thread: Enter string to the next line
- Next Thread: Program to display System date and Time in VC++ 6.0
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib 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 struct temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






