943,777 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 1316
  • C RSS
You are currently viewing page 1 of this multi-page discussion thread
Jun 7th, 2009
0

File handling

Expand Post »
void openfile(char *,FILE**)
what does double stars indicates
Similar Threads
Reputation Points: 18
Solved Threads: 1
Newbie Poster
seemant_sun is offline Offline
13 posts
since May 2009
Jun 7th, 2009
0

Re: File handling

void openfile(char *,FILE**)
what does double stars indicates
The second argument type is a pointer to a pointer to FILE type.
Didn't you understand what's a pointer?
Evidently this function returns FILE* pointer via this argument. What's a strange perversion...
Reputation Points: 1234
Solved Threads: 347
Postaholic
ArkM is offline Offline
2,001 posts
since Jul 2008
Jun 8th, 2009
0

Re: File handling

Well, it has one advantage over a return value -- you have to pass in an address, whereas you could ignore a return value. I don't think that's how I would write it, though.
Reputation Points: 185
Solved Threads: 28
Posting Whiz in Training
dwks is offline Offline
269 posts
since Nov 2005
Jun 8th, 2009
0

Re: File handling

>>you have to pass in an address

Not if you pass NULL.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,950 posts
since Aug 2005
Jun 9th, 2009
0

Re: File handling

How many times a pointer operator can appear with pointer to pointer declaration.
  1. int a;
  2. int *p;
  3. int **q;
  4. int ***r;
  5. int ****s;
  6. ....
  7.  
  8. p=&a;
  9. q=&p;
  10. r=&q;
  11. s=&r;
  12. ...
Is there any limit imposed by ANSI?
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008
Jun 9th, 2009
0

Re: File handling

That's it:
Quote ...
5.2.4.1 Translation limits
1 The implementation shall be able to translate and execute at least one program that contains at least one instance of every one of the following limits:
...
- 12 pointer, array, and function declarators (in any combinations) modifying an arithmetic, structure, union, or incomplete type in a declaration
...
Implementations should avoid imposing fixed translation limits whenever possible.
(256 in C++)
Reputation Points: 1234
Solved Threads: 347
Postaholic
ArkM is offline Offline
2,001 posts
since Jul 2008
Jun 9th, 2009
0

Re: File handling

Isn't 16 *'s maximum in C ???
I mean that *p,**p,***p.....
Last edited by csurfer; Jun 9th, 2009 at 10:49 pm.
Reputation Points: 485
Solved Threads: 88
Posting Pro
csurfer is offline Offline
564 posts
since Jan 2009
Jun 9th, 2009
0

Re: File handling

With VC++ 2008 Express, compiling a C program, I was able to compile char*(500 stars) ptr = "Hello"; before the parser complained. And then the error message was "parser stack overflow, program too complex"

Interestingly, as a c++ program I was able to give it about 920 stars before the compiler crapped out -- then it was during the link stage, not the compile stage.
Last edited by Ancient Dragon; Jun 9th, 2009 at 11:18 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,950 posts
since Aug 2005
Jun 10th, 2009
0

Re: File handling

curious, did you incrementally compile 1 additional indirection operator each time? did you use a scripting language to do it?
Reputation Points: 2143
Solved Threads: 178
Posting Maven
jephthah is offline Offline
2,567 posts
since Feb 2008
Jun 10th, 2009
0

Re: File handling

>Isn't 16 *'s maximum in C ???
I have never seen maximal values of translation limits were defined in C docs.
Reputation Points: 1234
Solved Threads: 347
Postaholic
ArkM is offline Offline
2,001 posts
since Jul 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Selection Sort for a Linked List (Using Double Pointers)
Next Thread in C Forum Timeline: size of a file





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC