return 64-bit int by identifier (was Re: return?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux