ambigious part 5

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2004
Posts: 31
Reputation: Sukhbir is an unknown quantity at this point 
Solved Threads: 0
Sukhbir Sukhbir is offline Offline
Light Poster

ambigious part 5

 
0
  #1
Aug 6th, 2004
LOOK THE FOLLOWING STATEMENT

int *p[]();

PLS TELL ME THE MEANING OF THIS STATEMENT.& WHERE WE USE THIS STATEMENT.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,413
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 248
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: ambigious part 5

 
0
  #2
Aug 6th, 2004
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: ambigious part 5

 
0
  #3
Aug 6th, 2004
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.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 256
Reputation: FireNet will become famous soon enough FireNet will become famous soon enough 
Solved Threads: 6
FireNet's Avatar
FireNet FireNet is offline Offline
Posting Whiz in Training

Re: ambigious part 5

 
0
  #4
Aug 6th, 2004
Good point too,the fourms are getting filled.Hey there's plenty of space in an ocean anyway.
See what you can, remember what you need

Fourzon | Earn via Coding
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC