•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 397,851 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,341 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 1732 | Replies: 3
![]() |
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
*/•
•
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,333
Reputation:
Rep Power: 11
Solved Threads: 101
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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
Similar Threads
- Using OpenGL in Visual C++: Part I (Game Development)
- 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



Linear Mode