Re: Function type
From: Emmanuel Delahaye (emdelYOURBRA_at_noos.fr)
Date: 07/11/04
- Next message: James Hu: "Welcome to comp.lang.c!"
- Previous message: Randy Howard: "Re: Executing a process within c"
- In reply to: Profetas: "Function type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 Jul 2004 17:20:30 GMT
In 'comp.lang.c', "Profetas" <xuxu_18@yahoo.com> wrote:
> I have the following printf
> printf("%s ",get_var_type(type));
>
> How do I make the get_var_type(type) return a char *type ?
> or do I have to return the address?
> Let me clarify.
If you mean 'type' in the meaning of the type of an object, you have it
wrong. 'type' is not a value. It can't be passed as a parameter to a
function.
All you can have from a type is its size in bytes with the unary
operator 'sizeof'. In that case, the type must be in the typecast form :
size_t n = sizeof (double);
Another possibility is that I completely misunderstood your post.
-- -ed- get my email here: http://marreduspam.com/ad672570 The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html C-reference: http://www.dinkumware.com/manuals/reader.aspx?lib=c99 FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
- Next message: James Hu: "Welcome to comp.lang.c!"
- Previous message: Randy Howard: "Re: Executing a process within c"
- In reply to: Profetas: "Function type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|