Re: RunTime Datatype Determination in C



dbansal wrote:

.... snip ...

I have a program. Please tell me what do you think about this.

ERROR: failure to #include <stdio.h>


int main(int x)

ERROR: main can have two or no parameters. Not one. Usual is:

int main(int argc, char **argv)

{
if(x==1)
{
int myval;
printf("size of integer myval: %d\n",sizeof (myval));

ERROR: printf without a prototype.
ERROR: sizeof returns size_t, not int. Use
("%lu\n", (unsigned long) sizeof myval);

}
else
{
float myval;
printf("size of real myval: %d\n",sizeof (myval));

ERROR: printf without a prototype.
ERROR: sizeof returns size_t, not int. See above.

}

ERROR: main returns int. "return 0;" will do.

}

So, apart from not being a legal C program, all is well.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>


.



Relevant Pages

  • SSPI Kerberos for delegation
    ... security context created in server to connect back and authenticate to ... DWORD bufsiz = sizeof buf; ... int n = ib.cbBuffer; ... // wserr() displays winsock errors and aborts. ...
    (microsoft.public.win32.programmer.kernel)
  • SSPI delegation using kerberos
    ... security context created in server to connect back and authenticate to ... DWORD bufsiz = sizeof buf; ... int n = ib.cbBuffer; ... // wserr() displays winsock errors and aborts. ...
    (microsoft.public.platformsdk.security)
  • SSPI Kerberos for delegation
    ... security context created in server to connect back and authenticate to ... DWORD bufsiz = sizeof buf; ... int n = ib.cbBuffer; ... // wserr() displays winsock errors and aborts. ...
    (microsoft.public.platformsdk.security)
  • SSPI Kerberos for delegation
    ... security context created in server to connect back and authenticate to ... DWORD bufsiz = sizeof buf; ... int n = ib.cbBuffer; ... // wserr() displays winsock errors and aborts. ...
    (microsoft.public.security)
  • Re: Can u tell me the explanation reg this problem
    ... value although it's implicitly declared to return int and there isn't a ... proper prototype of printf in scope), ... the Rationale addresses exactly the case at hand: ...
    (comp.lang.c)