Skip to content

Instantly share code, notes, and snippets.

@xnuk
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save xnuk/1cfac0de81058b86f7be to your computer and use it in GitHub Desktop.

Select an option

Save xnuk/1cfac0de81058b86f7be to your computer and use it in GitHub Desktop.
#pragma once
#include<stdio.h>
#define pint int*
#define pchar char*
#define ppchar char**
#define pfloat float*
#define pshort short*
#define pdouble double*
#define pvoid void*
#define castint (int)
#define castchar (char)
#define castshort (short)
#define castfloat (float)
#define castdouble (double)
#define cast(a,b) ((b)a)
#define mallocint(nn) ((int*)malloc(sizeof(int)*nn))
#define mallocchar(nn) ((char*)malloc(sizeof(char)*nn))
#define mallocfloat(nn) ((float*)malloc(sizeof(float)*nn))
#define mallocshort(nn) ((short*)malloc(sizeof(short)*nn))
#define mallocdouble(nn) ((double*)malloc(sizeof(double)*nn))
#define noparam ()
#define putint(a) printf("%d\n",a)
#define puthex(a) printf("%x\n",a)
#define putpointer(a) printf("%p\n",a)
#define putchar(a) printf("%c\n",a)
#define putfloat(a) printf("%f\n",a)
#define putdouble(a) printf("%lf\n",a)
#define forsquare(n,a) {register int i,j; for(i=0; i<n; i++)for(j=0; j<n; j++)a;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment