Displaying posts categorized under

C Language

Same code….Different output….

Friends, Try the following code in truboc and devc++ editor (gcc compiler). int i=5; printf("%d",i++ – i++ – –i – i–); and int i=5,n; n=i++ – i++ – –i – i–; printf("%d",n); As we expect, the  answer should be same. But it is different in both the compilers…..Why??? Please let me know if you knew [...]

Grabbing Pixels from PGM Image using C

#include<stdio.h> #include<string.h> #include<stdlib.h> /* * Auhtor : Anthoniraj.A * Date : 24/03/2009 */ int** imageRead(char imageName[]); void imageWrite(int** pels); int width, height; int **pixels; unsigned char *charImage;   int** imageRead(char imageName[]) { FILE* fp;   //PGM Headers Variable Declaration char* type; int *ptr; int q, i, j;   char header[100]; //Open file for Reading in [...]