// Str_to_Int.cpp : Defines the entry point for the console application. // #include "stdafx.h" int m_strlen(char *str) { int length =0; while(*str) { length ++; str++; } return length; } int stepen(int arg1, int n) { int i,res=1; for (i=0; i 0) { str[i]= (char)(*inT%10+48); *inT /= 10; i++; } //str[i]= (char)(*inT%10+48); str[i]='\0'; reverse(str); } int _tmain(int argc, _TCHAR* argv[]) { char str[256]; int inT,rep=1; char c[256]; while(rep) { printf("Select mode: 1 - Int to Str \n"); printf(" 2 - Str to Int \n"); printf("Enter integer value: "); scanf("%d",&inT); if (inT==1) { printf("Selected mode: Int to Str\n"); printf("Enter integer value: "); scanf("%d",&inT); int_to_str(&inT,str); printf("Returning Str value: '"); printf("%s'",str); printf("\n"); } else { printf("Selected mode: Str to int \n"); printf("Enter String value (digits only): "); getsİ; gets(str); str_to_int(str,&inT); printf("Returning Int value: "); printf("%d",inT); printf("\n"); } printf("Repeate? "); scanf("%d",&rep); } return 0; }