Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C PR0gramming..

Name: Anonymous 2012-05-26 3:39

Neeeed 'C' Help.

I need to read in input from the command line argument and open the text file ( 2nd arguement; nums1.txt in this case)
ie:  ./shitprogram nums1.txt

and so what would i be inputting here:
fopen("????","r");

I know that argv[1] = "nums1.txt" but how would i use this as a variable in fopen() ?

Name: Anonymous 2012-05-26 22:04

I use:
ALL_CAPS for preprocessor constants
some_name for local symbols
First_letter for symbols of function types
_some_name for global symbols
_, __, ___, ... for symbols that should not be used
__name_ for symbols that are deferred by a typedef
name_ for volatile symbols

as for the naming itself:
name_t for types
name_p for pointer types
name_c for types that are part of a bigger type
multiple_words for symbols with multiple words
CamelCase if the symbol is something that implements some OOP principles
camelCase if the symbol is a type of the above OOP implementation
i, j, k, l for generic cycles
ret for a local symbol to hold the return value
s, r, t for generic strings
file_name for most local symbols, the meaning is interesting on the local scope only

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List