Thread: Receiving an array in a function

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    53

    Receiving an array in a function

    If I have two global variables char filename[80] and char message[80]. If I want to pass them in to a different c file's functions. In one I put create_file(char* filename) in the other i put print_message(char message[])...are the two parameters the same? If I put char* message I get the same results either way. Is there any diff?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    If they're global variables then why are you passing them as parameters?

    >Is there any diff?
    No, the two are the same thing. Use the one you find to be more clear.
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    53
    Alright awesome...I'm still working on that big program project...I'm 40% done...I'll post if I have any further questions. Thanks for clearing that up. C PROGRAMMING WUT WUT\

    btw prelude = pimp

  4. #4
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    correction: Prelude would be a mistress, not a pimp.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  5. I need help with passing pointers in function calls
    By vien_mti in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 10:00 AM