Function type

From: Profetas (xuxu_18_at_yahoo.com)
Date: 07/10/04


Date: Sat, 10 Jul 2004 14:34:06 -0400

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.

I have a function that will receive a "string" as a parammeter and I would
like to return a "string"

notr "string" means pointer to a char



Relevant Pages

  • Re: segmentation fault
    ... Because the "%s" specifier tells printf that a string will be printed, ... But 'a' is a single char with no ... which this International Standard imposes no requirements". ...
    (comp.lang.c)
  • Memory leaking..
    ... char * strclear ... return string; ... printf; ... I think memory is leaking in the program. ...
    (comp.lang.c)
  • Re: strtof wont work
    ... I did have a printf statement that showed the contents of the strings prior ... I would have thought that if the printf command can see the string to print ... You are aware that a pointer to char is not the same thing as ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Using printf on char array
    ... then look up the signature of the printf() function. ... requires a char* as its first argument. ... requires it to be a null-terminated C-style string. ... > accepts a char array and then prints the entire array, ...
    (comp.lang.cpp)
  • need to push pop strings on a stack
    ... I need some C advice I want to read in string commands from a user ... void push; ... char cVal,cSwitch; ... printf; ...
    (comp.lang.c)