Char/Const char

This is a discussion on Char/Const char within the C Programming forums, part of the General Programming Boards category; What's the difference, in functions like fopen() Code: fopen(const char *filename, const char *mode) and functions without const, between a ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    13

    Char/Const char

    What's the difference, in functions like fopen()

    Code:
    fopen(const char *filename, const char *mode)
    and functions without const, between a char and a const char or const int and the like? Thanks.

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    The difference is that they guarantee that the data you pass won't be modified. What else?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. Sorting Linked Lists
    By DKING89 in forum C Programming
    Replies: 6
    Last Post: 04-09-2008, 07:36 AM
  3. code condensing
    By bcianfrocca in forum C++ Programming
    Replies: 4
    Last Post: 09-07-2005, 09:22 AM
  4. Passing structures... I can't get it right.
    By j0hnb in forum C Programming
    Replies: 6
    Last Post: 01-26-2003, 10:55 AM
  5. String sorthing, file opening and saving.
    By j0hnb in forum C Programming
    Replies: 9
    Last Post: 01-23-2003, 12:18 AM

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