Passing arguments to another function

This is a discussion on Passing arguments to another function within the C Programming forums, part of the General Programming Boards category; Code: int main(int argc, char *argv[]) If I then passed argv[1] to another function, how would I declare argv[1] in ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    145

    Passing arguments to another function

    Code:
    int main(int argc, char *argv[])
    If I then passed argv[1] to another function, how would I declare argv[1] in that function?

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    As char*.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    145
    Thanks got it now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 01:17 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. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  4. Replies: 9
    Last Post: 01-02-2007, 03:22 PM
  5. passing counters between function
    By BungleSpice in forum C Programming
    Replies: 18
    Last Post: 02-21-2004, 05:16 PM

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