It's doing that because tek-tips interprets the i enclosed in brackets as a symbol for italics.
> b= (void*) malloc (ARGC*sizeof(char[SIZE2]));
There is no reason to cast the return value of malloc(). Furthermore, malloc() already returns void * so this cast is superfluous anyway. And why even use the sizeof operator when you can just:
b=malloc(ARGC * SIZE2);
sizeof char is /always/ 1, by definition.
As to your last comment regarding the usage of & in array expressions:
char b[]="foo";
myfunc(b);
myfunc(&b);
are /not/ equivalent.
These are equivalent:
myfunc(b);
myfunc(&b[0]);
Assuming that you meant this, I'm quite confused as to why you so strongly discourage using the latter method. In fact, one might argue that using the & operator in such an expression might clarify things in some contexts:
/* Foo modifies s */
void foo (char *s) { /* ... */ }
int main(void)
{
char s[]="foo";
foo(&a[0]);
return 0;
}
I think it would be a reasonable argument to say that this clarifies things in the sense that the caller of the function is making it explicit that the address of the first element of the array is being passed to foo(), suggesting that the value of a will be modified in foo(). Yes, foo() states this explicitly, but suppose foo() were somewhere else hidden in a library somewhere?
I also don't understand your point as to dereferencing an extra * from an argument inside of a function because the caller chose to use &a[0] instead of a. The function argument is the same regardless of the syntax the caller uses to call the function.
Russ
bobbitts@hotmail.com