Send varible into C program

Discussion in 'C' started by chico1st, Jun 20, 2007.

  1. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    Hello I need to send a varible into one of my C programs. I dont know how to write the source code for this or actually call the file (while sending varibles).

    Do I need to compile the program as a dll to do this?

    Thank you for your time.
     
  2. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    the reason that i want to do this is because a have a C program that makes an output file but I call that program 30 times to make 30 output files.. so I want to send a string in to use as the output file name.
     
  3. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    Put the "variable" on the command line as an argument. See the usage for main's arguments, argc and argv []. Give it a shot and if you have troubles, post back with your attempted code.

    Be sure and learn about code tags before you post code (see the "Before you make a query" thread).
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice