Search
 
SCRIPT & CODE EXAMPLE
 

C

c conventions

You know, I like to keep it simple, but clear... So here's what I use, in C:

Trivial Variables: i,n,c,etc... (Only one letter. If one letter isn't clear, then make it a Local Variable)
Local Variables: camelCase
Global Variables: g_camelCase
Const Variables: ALL_CAPS
Pointer Variables: add a p_ to the prefix. For global variables it would be gp_var, for local variables p_var, for const variables p_VAR. If far pointers are used then use an fp_ instead of p_.
Structs: ModulePascalCase (Module = full module name, or a 2-3 letter abbreviation, but still in PascalCase.)
Struct Member Variables: camelCase
Enums: ModulePascalCase
Enum Values: ALL_CAPS
Public Functions: ModulePascalCase
Private Functions: PascalCase
Macros: PascalCase
Comment

PREVIOUS NEXT
Code Example
C :: c unused variable 
C :: C# special character display 
C :: how to debug a segmentation fault in c 
C :: find sum of all odd numbers from 1 to n using for loop 
C :: calling of a void in c 
C :: declaration of string in c 
C :: boolean operators in c 
C :: example of header file in c 
C :: *= operator 
C :: Symmetrical matrix in C 
C :: c for result 
C :: can we use logical operators in switch c 
C :: Here is a program in C that illustrates the use of fprintf() to write a text file: 
C :: run a command in cmd with c 
C :: how can i learn c game development 
C :: parcel-bundler include image files 
C :: C static libraries (creating object files) 
C :: counting sort using malloc and size-t type c 
C :: buble sort in c that ask user input 
C :: c++ to assembly language converter online 
C :: which one is faster loop or recursive function? 
C :: Array in element from lowest 
C :: Sum of upper & lower triangles elements 
C :: return multiple values using the call by reference 
C :: putting character in the begginig and end of sring C 
C :: snake spielen 
C :: gcc comand for running hello.c 
C :: c Write a program to reverse an array or string 
C :: latex font sizes 
Dart :: ElevatedButton flutter style 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =