Vikas,

On 7/15/05, Vikas S <[EMAIL PROTECTED]> wrote:
> I want to find out the size of a structure which the user will give as an 
> argument
> as follows.
> 
> #include <>  -- All includes..
> ..
> main(int arc, char *argv[])

   argv is a charecter pointer . You cannot pass struct * as an
arguement to main.

> {
> printf("Size of structure %s is: %d\n", argv[1], sizeof(struct argv[1]));

use strlen(argv[1]) to find the lenght of the string.

-- 
cheers,
Vadi
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to