counting # of args sending into a function...

This is a discussion on counting # of args sending into a function... within the C++ Programming forums, part of the General Programming Boards category; how to do with stdarg? va...

  1. #1
    A Banana Yoshi's Avatar
    Join Date
    Oct 2001
    Posts
    857

    counting # of args sending into a function...

    how to do with stdarg? va

  2. #2
    ˇAmo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    int main(int argc, char* argv[])

    There are argc parameters (including the name of the prog). They range from 0 to argc-1 in char* argv[].

  3. #3
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361

    Re: counting # of args sending into a function...

    Originally posted by Wraith_Master
    how to do with stdarg? va
    There's no way.
    Either predefine an argument which signals the end of the list, have the first argument set to the number of arguments you're passing or do something similar to the printf family of functions.

    http://www.eskimo.com/~scs/C-faq/q15.8.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 12:49 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  4. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01:53 AM
  5. Replies: 5
    Last Post: 02-08-2003, 06:42 PM

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