4

Are there any Unix man pages or similar standardized reference for variable type declarations (in c)?

For example, if I want details on the float variable type and different ways to declare it, is there a standardized reference in Unix? The compiler man pages? Or is an online reference or book on C required?

I just saw float power=2.345f when reading Learn C the Hard Way, was wondering what the f means, and quickly learned that man 3 float and man float do not produce anything, and even man -k float does not seem to show any relevant results.

So, where to look for definitive answers about c variable types and their declarations, preferably retrievable on the OS without internet access?

hilcharge
  • 1,515
  • 3
  • 12
  • 18
  • 1
    You need reference to the language, not an OS. Look for the standard specification docs. – Sourav Ghosh Jun 05 '15 at 11:46
  • The `f` suffix on a floating-point number makes it a `float` literal, rather than a `double` (which is the type of non-suffixed floating-point literals). – unwind Jun 05 '15 at 12:05

2 Answers2

1

Read the C11 standard. On wikipedia, you will find referencess to all standards, including the older ones. Do not worry (too much) about them being draft; that is mustly due to ortographic corrections, etc. The final versions will cost money, so most here (and elsewhere) use the drafts.

Linux man pages for C functions are mostly a courtesy and cover POSIX aspects. You should not rely they exist or complain they do not.

If you have problems reading the standard, just get a good book.

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
0

I have never seen a manual page for C/C++. I would probably download a manual like this for offline viewing: http://www.gnu.org/software/libc/manual/index.html

Jeremy
  • 818
  • 6
  • 19