Since 5/6/2012 12:51:34 AM, andrej.prsa has written 8 articles and participated in 10 conversations. andrej.prsa signature: andrej.prsa
andrej.prsa's articles:
Items(8) /1
Passing const int * to a function729 (1/4/2005 9:58:03 PM) comp.lang.c Hello, everyone! When a const int * argument is passed to a function, i.e. int f (const int *var) { printf ("%d\n", *var); } int main () { int var = 10; f (&var); } what does that exactly mean... Andrej
Global pointer pointing to locally defined type1623 (4/7/2004 7:16:29 AM) comp.lang.c Hi! What happens to a globally defined pointer, e.g. void *value; that points to a particular type in a function: int dummy_func (int a) { value = &a; return 0; } after the function returns t... Andrej
Passing va_list two times?244 (3/4/2004 1:03:28 AM) comp.lang.c Hi! If I declare two functions like this: int execute_command (char *name, ...) { va_list args; va_start (args, name); my_func (1, args); va_end (args); } int my_func (int argc, ...) { va_li... Andrej
Pointer-to-function with variable argument number523 (3/4/2004 12:15:11 AM) comp.lang.c Hi! Why do I get a warning about incompatible pointer type if I try to assign a pointer to the function with variable argument number: int func (int argc, ...) , but everything is ok when I'm using a sim... Andrej
Struct of pointer-to-function727 (3/2/2004 4:27:41 PM) comp.lang.c Hi! I'm trying to create a small scientific script language; my idea was to create a struct with the corresponding global variable like this: typedef struct commands { int recno; int *argc; char **nam... Andrej
Variable argument number in functions337 (9/4/2003 9:17:39 AM) comp.lang.c Hello! If I was to write a function that takes variable argument number that would simply call printf with those exact arguments, how do I pass them to printf? E.g. int my_printf (const char *fmt, ...) { ... Andrej
Testing if char *string was declared634 (7/8/2003 9:19:45 AM) comp.lang.c Hi! Is there a way to reliably test whether a string was ever declared? E.g. char *str; test (str); /* -> no */ str = strdup ("contents"); test (str); /* -> yes */ I managed to do it if I set cha... Andrej
Functions returning arbitrary type558 (7/5/2003 11:07:17 PM) comp.lang.c Hello, List! Does ANSI C support in any way functions that return different types depending on the given arguments? I.e. int my_function (int arg) double my_function (double arg) char *my_function (char *arg)... Andrej
andrej.prsa's replies:
Items(5) /1
Pointer-to-function with variable argument number523 (3/4/2004 12:15:11 AM) comp.lang.c Hi! Why do I get a warning about incompatible pointer type if I try to assign a pointer to the function with variable argument number: int func (int argc, ...) , but everything is ok when I'm using a sim... andrej.prsa(18)
Global pointer pointing to locally defined type1623 (4/7/2004 7:16:29 AM) comp.lang.c Hi! What happens to a globally defined pointer, e.g. void *value; that points to a particular type in a function: int dummy_func (int a) { value = &a; return 0; } after the function returns t... andrej.prsa(18)
Passing const int * to a function729 (1/4/2005 9:58:03 PM) comp.lang.c Hello, everyone! When a const int * argument is passed to a function, i.e. int f (const int *var) { printf ("%d\n", *var); } int main () { int var = 10; f (&var); } what does that exactly mean... andrej.prsa(18)
Testing if char *string was declared634 (7/8/2003 9:19:45 AM) comp.lang.c Hi! Is there a way to reliably test whether a string was ever declared? E.g. char *str; test (str); /* -> no */ str = strdup ("contents"); test (str); /* -> yes */ I managed to do it if I set cha... andrej.prsa(18)
Struct of pointer-to-function727 (3/2/2004 4:27:41 PM) comp.lang.c Hi! I'm trying to create a small scientific script language; my idea was to create a struct with the corresponding global variable like this: typedef struct commands { int recno; int *argc; char **nam... andrej.prsa(18)