-
/*atof örneği*/
#include "stdio.h"
#include "stdlib.h"
int main()
{
double d;
d=atof("99.0 7");
printf("%s%.3f\n%s%.3f\n",
"\"99.0\"stringi double'tipine donusturuldu",d,
"donusturen sayinin 2 ye bolumu ",
d/2.0);
system("PAUSE");
return 0;
}
#include "stdio.h"
#include "stdlib.h"
#include "conio.h"
/*atoi örneği*/
int main()
{
int i;
i = atoi("2593");
printf("%s%d\n%s%d\n",
"\"2593\" stringi int tipine donusturuldu: ", i,
"Donusturulen sayi eksi 593: ", i - 593);
getch();
return 0;
}
/*atol örneği*/
#include "stdio.h"
#include "stdlib.h"
#include "conio.h"
int main()
{
long i;
i = atol("1000000");
printf("%s%ld\n%s%ld\n",
"\"1000000\" stringi long int tipine cevrildi ", i,
"cevrilen degerin 2' ye bolumu: ", i / 2);
getch();
return 0;
}
/*string dönüştürme örneği*/
#include "conio.h"
#include "stdio.h"
#include "stdlib.h"
int main()
{
long x;
const char *string = "-1234567abc";
char *kalanPtr;
x = strtol(string, &kalanPtr, 0);
printf("%s\"%s\"\n%s%ld\n%s\"%s\"\n%s%ld\n",
"Orjinal string: ", string,
"Donusturulen deger: ", x,
"Orjinal stringden geriye kalan: ",
kalanPtr,
"Donunusturulen deger arti 567: ", x + 567);
getch();
return 0;
}
/*metni tersten yazdirma örneği*/
#include "stdio.h"
#include "conio.h"
int main( )
{
char cumle[80];
void ters(const char * const);
printf("Metin girisi yapiniz:\n");
gets(cumle);
printf("\nGirdiginiz metin tersten yazildiginda:\n");
ters(cumle);
getch();
return 0;
}
void ters(const char * const sPtr)
{
if(sPtr[0]=='\0')
return;
else
{
ters(&sPtr[1]);
putchar(sPtr[0]);
}
}
/*dizilerde integer ve double ayırma örneği*/
#include "stdio.h"
#include "conio.h"
int main()
{
char s[ ] = "31298 87.375";
int x;
double y;
sscanf(s,"%d%lf", &x, &y);
printf("%s\n%s%6d\n%s%8.3f\n",
"s karakter dizisinde saklanan degerler:",
"integer:", x, "double:", y);
getch();
return 0;
}
/*stringde eksiltme örneği*/
#include "stdio.h"
#include "conio.h"
#include "string.h"
int main()
{
char x[ ] = "Dogum gunun kutlu olsun";
char y[25],z[15];
printf("%s%s\n%s%s\n",
"x dizisindeki string: ", x,
"y dizisindeki string:", strcpy(y, x));
strncpy(z, x, 11);
z[11] = '\0';
printf("z dizisindeki string: %s\n", z);
getch();
return 0;
}
bu ne yaw... en son bloguma ders notlarımızın son derste işlenenleri koymuştum onlar kalmış. :D
-
- #commentlist .trackback{ background:#f2f2f2; margin-bottom: 5px; margin-top: 5px; }
- #commentlist .pingback{ background:#fff4fe; margin-bottom: 5px; margin-top: 5px; }
- #commentlist .admin { background-color: #000; margin-bottom: 5px; margin-top: 5px; color:#fff }
Kodlarla oynuyomuşum galiba :)
-
-
Tra lai em niem vui khi duoc gan ben em, tra lai em loi yeu thuong em dem, tra lai em niem tin thang nam qua ta dap xay. Gio day chi la nhung ky niem buon... Site Banned For Spam - web hosting, ecommerce web hosting, web site hosting, web hosting services, web hosting provider, internet hosting, cheap web hosting, web site hosting, web hosting services, web hosting provider, internet hosting web hosting,
Bu ne lan!!!
-
-
-
-
[ame=http://www.youtube.com/watch?v=AF2hzA5RNwg]Telekomünikasyon İletişim Başkanlığı[/ame]
aaa bu varmış :D
izleyin manyak adam
-
Wild at Heart (1990) 1080p.BluRay.DTS.x264-CtrlHD [RS+NL]
-