| | |
Declaring an array of records in MC++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
C++ Syntax (Toggle Plain Text)
struct Record { string title; int playtime; Record *next; }; Record **ListOfRecords = new Record*[42];
If MC is a C or C++ compiler, you have to put a number inside those brackets to tell it how big that array is going to bel
Record ListOfRecords[100];
You don't need another pointer in order to pass it to another function.
Record ListOfRecords[100];
You don't need another pointer in order to pass it to another function.
// use only ONE of the following, not all three. It shows three ways // to code the function. void foo(Record ListOfRecords[100]) void foo(Record ListOfRecords[]) << this is also ok void foo(Record* ListOfRecords) << so is this { // blabla } int main() { Record ListOfRecords[100]; // pass the array to function foo() foo(ListOfRecords); <<< see here }
![]() |
Similar Threads
- Loading a .Dat into a Array of records help. (Pascal and Delphi)
- Run-time Error when printing Array Contents. (C)
- adding data into an char array (C++)
- array declaration explanation needed (C)
Other Threads in the C++ Forum
- Previous Thread: Counting Spaces in a string
- Next Thread: Dev C++ Help!
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory newbie news number output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg simple string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






