Sunday, September 20, 2009

oop344

Challenge: write this function without using any library functions; void GetInt(char *strint, int val);
this function gets an integer value and converts it to a string ("strint")

GetInt(char *strint, int val){
char p[100];
int a=0,c=0,i=0,j=0;
a=val;
while (a/10 > 0){
c = a ;
p[i++] = '0' + c % ((a=a/10)*10);
}
p[i++] = '0'+ a;
p[i] ='\0';
while (i >0 )
strint[j++] = p[--i];
strint[j]='\0';
printf("%s\n",strint);
}


Monday, September 14, 2009

OOP344

Today I learn press ctrl + F5 in Visual Studio 2008 to start without debugging program.