News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Is there like a C programming dictionary for commands?  (Read 3289 times)

fellowroot

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Is there like a C programming dictionary for commands?
« on: April 04, 2013, 11:32:47 pm »
I'm taking a course in C and I run into stuff that I don't know all the time like:

fgets(buffer, BUFFER_SIZE - 1, stdin);

exit(EXIT_FAILURE);

return EXIT_SUCCESS;

and so on.

So is there like a C dictionary where I can look up stuff I don't know.

« Last Edit: April 05, 2013, 11:03:35 pm by MathOnNapkins »

Bisqwit

  • Sr. Member
  • ****
  • Posts: 369
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Is there like a C programming dectionary for commands?
« Reply #1 on: April 04, 2013, 11:45:46 pm »
You probably ought to ignore the details for now and concentrate on the message. You will understand those details as you gain insight into how functions work in general.

You can find a reference on C functions at many websites -- http://www.acm.uiuc.edu/webmonkeys/book/c_guide/ was the first one I found, but to understand them you need indeed to have that insight into how functions work in general.

STARWIN

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
Re: Is there like a C programming dectionary for commands?
« Reply #2 on: April 05, 2013, 01:37:11 am »
i have been using http://www.cplusplus.com/reference/clibrary/ for years, whenever i need to check something about C. you can ignore all C++ stuff.

almost everything you write is defined in a header. so the information in this site is organized by the header file names. for example the stdlib.h page tells you what EXIT_FAILURE, exit etc mean. if you have a code file with unknown words, check the documentation related to the header files #included in that code file. this logic should solve most cases.

BRPXQZME

  • Hero Member
  • *****
  • Posts: 4572
  • じー
    • View Profile
    • The BRPXQZME Network
Re: Is there like a C programming dectionary for commands?
« Reply #3 on: April 05, 2013, 01:41:19 am »
On a Unix system, you can use the man (manual) pages for any standard C library function (it may also tell you about functionality specific to that flavor of Unix, though, and not tell you that it’s non-standard), for example, the command “man fgets” or “man 3 exit” at the command line. This is the way these were supposed to be looked up pretty early on. However, we don’t all use Unix systems, and some of us are not familiar with the command line. In fact, while I recommend both of these things, the fact is that a majority of people learning programming use Windows. Usually we are not interested in the system-specific version of a function, either.

The point of telling you this is that you can go to Google and do a search like “man <function name>” (no quotes) and you will find a bare-bones explanation of what the function does, same as a Unix manual would tell you. You will probably not be given the whole picture; it may not explain things well enough for people who wouldn’t already know what it does, and it will often not even tell you whether it’s even a good idea to use that function! But if you are truly lost, it can give you enough of a description as to what you should look up next.

Constants and macros like EXIT_* would not generally be described in man pages, and for those you should consult the relevant header files.
we are in a horrible and deadly danger

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Is there like a C programming dectionary for commands?
« Reply #4 on: April 05, 2013, 10:31:18 am »
And with "consult" he means "find and open in your code editor".

syntax error

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: Is there like a C programming dectionary for commands?
« Reply #5 on: April 05, 2013, 05:11:10 pm »
You can get a cross-Compiler for almost every computer or console.

fellowroot

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Is there like a C programming dictionary for commands?
« Reply #6 on: April 05, 2013, 06:19:23 pm »
Thanks guys. I am checking out the links as I'm typing this.

Also I can't believe that I spelled dictionary wrong. Good god.