| | |
ambigious part 5
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
I believe it is invalid syntax. Did you mean a declaration for an array of pointers returning int and taking no parameters?
#include <iostream>
int foo() { std::cout << "foo\n"; return 0; }
int bar() { std::cout << "bar\n"; return 0; }
int main()
{
int (*p[])() = {foo,bar};
p[0]();
p[1]();
return 0;
}
/* my output
foo
bar
*/ "One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Sukhbir:
Can you please stop naming your threads "Ambiguous part #", and start naming them with a title that indicates what you're asking?
One of the keys to getting responses to your posts is to post a relevant topic to your question. "Ambiguous part #" is, well, ambiguous.
Can you please stop naming your threads "Ambiguous part #", and start naming them with a title that indicates what you're asking?
One of the keys to getting responses to your posts is to post a relevant topic to your question. "Ambiguous part #" is, well, ambiguous.
Alex Cavnar, aka alc6379
![]() |
Similar Threads
- Technical Writer (Part-Time) (Tech / IT Consultant Job Offers)
- ambigious part 6 (C)
- ambigious part 4 (C)
Other Threads in the C++ Forum
- Previous Thread: DECLARATION SYNTAX ERROR (for bc 31 user)
- Next Thread: storing large numbers
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count database delete deploy developer dll download dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph gui homeworkhelp iamthwee ifstream image input int java lib library linker list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






