The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
restricted pointers carl.alv High Level Programming 0 02-29-2008 07:34 PM
pointers Milla High Level Programming 2 11-03-2007 01:13 AM
Pointers and array dianazheng High Level Programming 2 11-04-2004 03:49 PM
Regarding Function and Pointers. S.Vishwanath High Level Programming 0 05-25-2004 05:15 AM
Pointers to Arrays Jayathirtha High Level Programming 2 09-05-2001 12:36 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-05-2006
Registered User
 

Join Date: Jul 2006
Posts: 27
pointers

is this a valid c declaration

int (*ptr(int *b))[5];

plz explain...
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-05-2006
Hitori's Avatar
Registered User
 

Join Date: Jun 2006
Posts: 356
valid,
this is a declaration of function with argument int* that returns pointer to an array of int*:

int (*ptr(int *b))[5];
int i;
int (*pi)[5] = ptr(&i);
i = *pi[0];
Reply With Quote
  #3 (permalink)  
Old 08-05-2006
Supporter
 

Join Date: Jul 2006
Posts: 156
Why do you ask if this is valid? A simple compile would have shown whether it is valid or not. This looks like homework. This is against rule #6.

Quote:
(6) Do not post classroom or homework problems.
And please follow rule number 9 as well:
Quote:
(9) Edit your posts if you see spelling or grammar errors (don't write in cyberchat or cyberpunk style). English only.
"please" is only 3 more characters than "plz".
Reply With Quote
  #4 (permalink)  
Old 08-05-2006
Hitori's Avatar
Registered User
 

Join Date: Jun 2006
Posts: 356
Quote:
Originally Posted by nathan
Why do you ask if this is valid? A simple compile would have shown whether it is valid or not. This looks like homework. This is against rule #6.



And please follow rule number 9 as well:


"please" is only 3 more characters than "plz".
Hey, don't frighten people. Simple question, simple answer. What a problem?
Reply With Quote
  #5 (permalink)  
Old 08-05-2006
Supporter
 

Join Date: Jul 2006
Posts: 156
The problem, Hitori, is that it is obviously evident that no effort was put into this question.

Every one of these posts by areef4u has either been closed, or if not closed, areef4u has been warned not to post homework questions.

sparse files
Unix
bitwise operators
testing
memory addresses
pseudo driver
Linux
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0