public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Use of typeof
@ 2002-03-01  8:03 Philip Cheng
  2002-03-02 11:04 ` Kevin Bailey
  0 siblings, 1 reply; 4+ messages in thread
From: Philip Cheng @ 2002-03-01  8:03 UTC (permalink / raw)
  To: gcc-help

I would like to use typeof to determine the type of a variable.  
However, I keep getting the error when I try to compile the program.

  test.c: In function `main':
  test.c:8: parse error before "typeof"

Anyone knows how can I solve the problem?  Thanks in advance for your help.

Philip


Here is my test program:

#include <stdio.h>

main()
{
        double  dftest;
        dftest = 1.0;

        if (__builtin_types_compatible_p (typeof (dftest), double)) 
            printf("It is double\n");
} 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-03-04 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-01  8:03 Use of typeof Philip Cheng
2002-03-02 11:04 ` Kevin Bailey
2002-03-02 13:43   ` Kevin Bailey
2002-03-04  6:36   ` Philip Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).