File handling

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: May 2009
Posts: 13
Reputation: seemant_sun is an unknown quantity at this point 
Solved Threads: 1
seemant_sun seemant_sun is offline Offline
Newbie Poster

File handling

 
0
  #1
Jun 7th, 2009
void openfile(char *,FILE**)
what does double stars indicates
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: File handling

 
0
  #2
Jun 7th, 2009
Originally Posted by seemant_sun View Post
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...
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 251
Reputation: dwks has a spectacular aura about dwks has a spectacular aura about 
Solved Threads: 25
dwks's Avatar
dwks dwks is offline Offline
Posting Whiz in Training

Re: File handling

 
0
  #3
Jun 8th, 2009
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.
dwk

Seek and ye shall find.

"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.

"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison

"The only real mistake is the one from which we learn nothing."
-- John Powell
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,500
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1479
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: File handling

 
0
  #4
Jun 8th, 2009
>>you have to pass in an address

Not if you pass NULL.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,689
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 481
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: File handling

 
0
  #5
Jun 9th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: File handling

 
0
  #6
Jun 9th, 2009
That's it:
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++)
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 476
Reputation: csurfer is just really nice csurfer is just really nice csurfer is just really nice csurfer is just really nice csurfer is just really nice 
Solved Threads: 76
csurfer's Avatar
csurfer csurfer is offline Offline
Posting Pro in Training

Re: File handling

 
0
  #7
Jun 9th, 2009
Isn't 16 *'s maximum in C ???
I mean that *p,**p,***p.....
Last edited by csurfer; Jun 9th, 2009 at 10:49 pm.
I Surf in "C"....
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,500
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1479
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: File handling

 
0
  #8
Jun 9th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 1,660
Reputation: jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of 
Solved Threads: 123
jephthah's Avatar
jephthah jephthah is offline Offline
Posting Virtuoso

Re: File handling

 
0
  #9
Jun 10th, 2009
curious, did you incrementally compile 1 additional indirection operator each time? did you use a scripting language to do it?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: File handling

 
0
  #10
Jun 10th, 2009
>Isn't 16 *'s maximum in C ???
I have never seen maximal values of translation limits were defined in C docs.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC