| | |
Is this legal?
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
If I declare a struct node, is the following legal in C++?
I know this is not legal in C. However, my C++ compiler does not complain. Is this only in recent versions of C++, or has this always been legal in C++?
node nodes_array[vector.size()]; I know this is not legal in C. However, my C++ compiler does not complain. Is this only in recent versions of C++, or has this always been legal in C++?
Last edited by titaniumdecoy; Jul 4th, 2008 at 6:12 pm.
In C99, the latest C standard, that would be legal. (Well, not the "vector.size()", but the runtime initialization of the array size.) You can use
instead -- if you have the boost libraries installed.
C++ Syntax (Toggle Plain Text)
scoped_array<node> nodes_array(new node[vector.size()]);
instead -- if you have the boost libraries installed.
![]() |
Similar Threads
- OPEN INVITATION for Link Exchange with our LAW,ATTORNEY,LEGAL,BEDT related websites! (Relevant Link Exchanges)
- Is invision power board free? :S (Existing Scripts)
- What is a proxy server and is it legal? (Network Security)
- Answers to legal ISSUES (IT Professionals' Lounge)
Other Threads in the C++ Forum
- Previous Thread: damages when executing console from MFC
- Next Thread: Missing Library in Compiling
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






