[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
return 64-bit int by identifier (was Re: return?)
Mark Hounschell <dmarkh@cfl.rr.com> writes:
> Is it possible to have a function return a 64 bit variable using
>
> return 64bitvarname
>
> ?????
Hi. That sounds like a question about the C language, but assuming
that you only care about gcc (since this is kernelnewbies), why not
just check and see?
ecashin@marblerye tmp$ cat test.c
#include <stdio.h>
long long f(void)
{
long long i = 0x0123456789abcdefLL;
return i;
}
int main(void)
{
long long i = f();
printf("0x%Lx\n", i);
return 0;
}
ecashin@marblerye tmp$ gcc -W -Wall -g test.c
ecashin@marblerye tmp$ ./a.out
0x123456789abcdef
ecashin@marblerye tmp$
--
--Ed L Cashin | PGP public key:
ecashin@uga.edu | http://noserose.net/e/pgp/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
- References:
- return?
- From: Mark Hounschell <dmarkh@cfl.rr.com>