Preprocessor possibilities1530 (12/13/2005 5:39:45 PM) comp.lang.c Is it possible to write a macro (in unextended C89) such that TEST( int, (1,2,3) ); expands to int array[]={ 1,2,3 }; ? I strongly suspect that it is not, but I don't wish to overlook a solution if one exi... Christopher
Passing structs by value1736 (12/5/2005 5:20:20 AM) comp.lang.c Does the following program exhibit undefined behavior? Specifically, does passing a struct by value cause undefined behavior if that struct has as a member a pointer that has been passed to free()? #include ... Christopher
Type of result of pointer arithmetic249 (12/2/2005 10:50:21 PM) comp.lang.c int main( void ) { int foo[10], *bar=foo, *baz=foo+1; int quux=baz-bar; return 0; } Is the type of quux (that is, int) strictly correct? Or is there a type similar to size_t that is more appropriate for... Christopher
Comparing signed and unsigned values626 (11/4/2005 4:37:40 PM) comp.lang.c++ int main() { bool foo=false; for( unsigned int bar=0; bar < (foo?1:2); bar++ ) { bar=42; } return 0; } A certain C++ compiler I am using claims that there exists in the above code (on the line with... Christopher
Why doesn't strrstr() exist?14592 (8/25/2005 2:07:01 PM) comp.lang.c (Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? -- Christopher Benson-Manica... Christopher
Flexible array, a la C99436 (7/28/2005 11:19:26 PM) comp.lang.c++ The following program is, to the best of my knowledge, a conforming C99 program: #include typedef struct foo { int whocares; int bar[]; } foo; int main() { return( 0 ); } The declaration of the ze... Christopher
Flexible size array248 (7/28/2005 11:13:32 PM) comp.lang.c Is the following program conforming under C99? #include typedef struct foo { int bar; int baz[]; } foo; foo foos[]={ { 1, {1,2,3} } }; int main() { return 0; } gcc -Wall -pedantic -std=c99 (3.3... Christopher
Return type of main()437 (6/22/2005 4:39:40 PM) comp.lang.c What do you think of this argument that conforming programs may declare main() as returning void? http://homepages.tesco.net/~J.deBoynePollard/FGA/legality-of-void-main.html -- Christopher Benson-Manica | ... Christopher
"delete this" question3224 (6/22/2005 12:24:15 PM) comp.lang.c++ Is the following code legal, moral, and advisable? #include class A { private: int a; public: A() : a(42) {} ~A() { std::cout go(); return 0; } Specifically, are B and A's destruc... Christopher
modf() question341 (4/8/2005 2:37:49 PM) comp.lang.c Given that modf is prototyped as double modf( double x, double *iptr ); is the behavior of the function well-defined if the address of x is passed as the value of iptr? -- Christopher Benson-Manica | I *sh... Christopher
function returning a string?831 (1/4/2006 2:37:19 PM) comp.lang.c Hi, how to write a function that would return a string? I've tried something like this: char enterstring(void) { char somestring[15]; printf("\tstring: "); fgets(somestring, sizeof somestri... alternativa.4(18)
stdin help3036 (1/4/2006 4:13:34 PM) comp.lang.c i need to check the stdin, repeatedly for an input form the keyboard, with out prompting the user to press a key or without returning pressed key on screen.. now the problem is that if i use getc() the program... sajjanharudit(18)
c and webservices?2026 (1/4/2006 4:23:39 PM) comp.lang.c Is it possible to consume web services with c? If not, what other languages would be needed to accomplish this? H ... elibol(9)
SQLServer360.com1134 (1/6/2006 2:29:06 AM) comp.lang.c Hello, I am new to Google Groups, my name is Derek Comingore. I have just recently started an online sql server community at www.sqlserver360.com (yes I am an XBox junkie as well). The idea behind the organiza... comingdt(5)
fwrite problems...629 (1/6/2006 11:58:38 AM) comp.lang.c Hi everyone, I am using the below listed code #include #include #include int main() { char *obuf=NULL; FILE *stream=NULL; int i=0; stream=fopen("top","wb"); obuf= (char*)malloc(8192); ... sumit1680(13)
dereferencing pointer to incomplete type535 (1/7/2006 11:42:39 AM) comp.lang.c Hello, I get the following message during compilation: `dereferencing pointer to incomplete type' It stems from the compare function I use with qsort() and I am not quite sure how to fix it. I have a struct ... Steven5029(9)
simple malloc question938 (1/9/2006 7:40:59 AM) comp.lang.c Hi, I have a question about malloc. When I do this: char **p = malloc(12); does malloc implicitly do 12 * sizeof(char*) for me? or would I have to explicitly do it? If it does not implicitly do it, then wha... xllx.relient.xllx(22)