0

im not sure exactly what its called or how to use it.. but im guessing its used to pass over variables as arguments to a function, ive only seen it in functions with this added after it: ,...) somewaht similar to the code below..

int myfunc(char *data,const char *data2[B],...[/B])
{
    ....
    return 0;
}

int main(void)
{
    char varhold[21];
    memset(varhold,0,sizeof(varhold));
    sprintf(varhold,"bob");
    myfunc("hey","hi %s",varhold);
    return 0;
}

can someone tell me what it is? how to use it? examples?

3
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by osean
0

im not sure exactly what its called or how to use it.. but im guessing its used to pass over variables as arguments to a function, ive only seen it in functions with this added after it: ,...) somewaht similar to the code below..

int myfunc(char *data,const char *data2[B],...[/B])
{
    ....
    return 0;
}

int main(void)
{
    char varhold[21];
    memset(varhold,0,sizeof(varhold));
    sprintf(varhold,"bob");
    myfunc("hey","hi %s",varhold);
    return 0;
}

can someone tell me what it is? how to use it? examples?

The 3 dots "..." are not part of C or C++. Presumably whichever book you are using is obscuring some of the function's definition... It might mean that whatever would be behind those 3 dots is unimportant to the example in your book, but that is just as guess

0

i am not reading any book, its part of the actual source in several opensource applications i have seen.. i am specifically taking it from Unreal 3.1, and if i dont have those three dots within the function it wont compile.. im just wondering what they do

0

sunnypalsingh hit it right on the dot, thanks!
after searching google for a minute or so i found http://www.cprogramming.com/tutorial/c/lesson17.html (i probably should of checked there anyway before posting) which gives a bit of information on using argument lists in functions if anyone reading this cares or wants to know.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.