Skip to content

Instantly share code, notes, and snippets.

@crissilvaeng
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crissilvaeng/5ccbe9469e6296259822 to your computer and use it in GitHub Desktop.
Save crissilvaeng/5ccbe9469e6296259822 to your computer and use it in GitHub Desktop.
C Coding Style
#define SUCCESS 0
#define NULL_ARGS 1
#define NULL_PARAM -1
#include <stdio.h>
#include "error.h"
int unsigned_sum( const unsigned int& x, const unsigned int& y );
int main( int argc, char* argv[] )
{
if( argc != 0 )
{
unsigned int a, b;
unsigned_sum( a, b );
return SUCCESS;
} else {
return NULL_ARGS;
}
}
int unsigned_sum( const unsigned int& x, const unsigned int& y )
{
if( !x || !y )
{
return NULL_PARAM;
}
return x + y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment