The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Does KSH support data type conversion? joshuaduan Shell Programming and Scripting 2 06-26-2007 03:12 AM
Value too large to be stored in data type??? limame AIX 5 06-18-2007 10:35 PM
Human readable type vs MIME type detection using file spauldingsmails Shell Programming and Scripting 0 03-22-2007 12:43 AM
data type limitation ALTRUNVRSOFLN High Level Programming 2 11-01-2005 06:30 PM
time_t data type-- what does start +1 mean? whatisthis High Level Programming 9 09-15-2005 01:57 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 01-27-2005
milhan milhan is offline
Registered User
  
 

Join Date: Oct 2002
Location: /home
Posts: 133
FILE data type

Hi all,
Can anyone tell me a little about the datatype FILE, which represents stream. What does its structure look like, and in which header file is it defined and so on...

Ex :
Code:
      FILE *fp ;
      fp = fopen("filename", "w") ;
  #2 (permalink)  
Old 01-27-2005
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2004
Location: USA
Posts: 511
it is in stdio.h

Code:

typedef struct {
        unsigned char   *_ptr;
        int     _cnt;
        unsigned char   *_base;
        unsigned char   *_bufendp;
        short   _flag;
        short   _file;
        int     __stdioid;
        char    *__newbase;
#ifdef _THREAD_SAFE
        void *_lock;
#else
        long    _unused[1];
#endif
#ifdef __64BIT__
        long    _unused1[4];
#endif /* __64BIT__ */
} FILE;
  #3 (permalink)  
Old 01-27-2005
milhan milhan is offline
Registered User
  
 

Join Date: Oct 2002
Location: /home
Posts: 133
thanks for the answer, but when I go in the stdio.h file, there's no such definition. Instead, there's a statement like :

Code:
using std::FILE ;
where is std?
  #4 (permalink)  
Old 01-28-2005
armen armen is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 29
The standard C++ namespace.
  #5 (permalink)  
Old 01-28-2005
milhan milhan is offline
Registered User
  
 

Join Date: Oct 2002
Location: /home
Posts: 133
Quote:
Originally Posted by armen
The standard C++ namespace.
yes, i know, it's c++ namespace, but how can I can and view what is inside the namespace, where is that std file?
  #6 (permalink)  
Old 01-28-2005
guenter guenter is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 24
hi
the std-namespace must also be defined somewhere.
in solaris stdio.h includes iso/stdio_iso.h where the c++-namespace std is defined.
the gnu c-compiler (gcc) has the flag -E which only applies the c-preprocessor and writes the generated text to the output. preprocessor output is described in http://www.delorie.com/gnu/docs/gcc/cpp_47.html
whicth this output you can see all macro-definitions expanded and from where they come from. perhaps other compilers have similar options.
guenter
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0