|
From: Luigi S. <gi...@li...> - 2001-08-28 03:31:33
|
Hi!
Sorry, my answer was a little confusing, I wrote it after compiling this
small example:
test.c
------
/*********************************************************************
test things like: int tab[10, 2]
*********************************************************************/
#include <stdio.h>
void
print_arr(const int *, int);
/********************************************************************/
int
main()
{
int x;
int tab[10, 2];
x = 1, printf("x = %d\n", x);
tab[0] = 1;
tab[1] = 10;
print_arr(tab, 2);
return 0;
}
/********************************************************************/
void
print_arr(const int *arr, int n)
{
int i;
for(i = 0; i < n; i++)
printf("arr[%d] = %d\n", i, arr[i]);
}
---
When you compile it you should see the message:
test.c:17: warning left-hand operand of comma has no effect
So "do something with 10 (actually nothing)" was my pesonal translation
of the above warning message. :-)
At 15.03 26/08/01 +0200, you wrote:
> > In the same fashion, the "int Tab[10, 2]" means: do "something with 10"
> > (actually nothing) and allocate memory (in static sense) for an array of 2
> > integers.
>
>Do something with 10 ? Doing what ?
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--
gisan
gi...@li...
|