What is ";" ?

This is a discussion on What is ";" ? within the C Programming forums, part of the General Programming Boards category; I'm trying to read some data from a file. How would I read something that looks like this: picture frame;...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    23

    What is ";" ?

    I'm trying to read some data from a file. How would I read something that looks like this:

    picture frame;

  2. #2
    Registered User Azuth's Avatar
    Join Date
    Feb 2002
    Posts
    236
    I'm not quite sure what you mean. ; should read like anything else. Post some code. How are you trying to read from the file? And what's not working?
    Demonographic rhinology is not the only possible outcome, but why take the chance

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685

    For all I know that is what the file contained

    ';' is a semicolon or ascii character 59. Perhaps you see a ';' because there is crap being spit onto the screen. I'm not sure without code.

  4. #4
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Code:
    int main()
    {
      //declarations
      extern const int buffer_size;
      extern char buffer[];
      extern FILE *fptr;
    
      while ( fgets( buffer, buffer_size, fptr) != NULL)
      {
         printf("%s", buffer);
       }
       fclose(fptr);
       ...
       return 0;
    }
    Here is one general form. The datatypes are from another file. I think I did the fgets correctly. It will read all the lines in the file (line by line) and print them on the screen.

    In general you have to:
    1) Open a file
    2) Read the contents into and array
    3) Close the file

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What does "{}" mean in C++?
    By meili100 in forum C++ Programming
    Replies: 11
    Last Post: 01-04-2008, 05:41 PM
  2. What is "..." and "##"
    By meili100 in forum C++ Programming
    Replies: 4
    Last Post: 01-03-2008, 12:08 AM
  3. What does these lines do after ":" mark?
    By asilter in forum C++ Programming
    Replies: 7
    Last Post: 09-27-2007, 08:31 AM
  4. parse error before "{" token
    By getout in forum C Programming
    Replies: 4
    Last Post: 12-31-2006, 01:26 PM
  5. Replies: 3
    Last Post: 11-11-2003, 03:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21