08.11.2014 Views

c_kitap

c_kitap

c_kitap

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C ve Sistem Programcıları Derneği - C Ders Notları - Necati Ergin<br />

#include <br />

#include <br />

#define MAX_WORD_LEN 100<br />

#define ARRAY_SIZE 1000<br />

void revprint(const char *str)<br />

{<br />

char s[MAX_WORD_LEN + 1] = "";<br />

int index = 0;<br />

static const char seps[] = " \n\t,.:;!?";<br />

while (*str && strchr(seps, *str))<br />

str++;<br />

if (!*str)<br />

return;<br />

while (!strchr(seps, *str))<br />

s[index++] = *str++;<br />

s[index] = '\0';<br />

if (*str == '\0') {<br />

printf("%s ", s);<br />

return;<br />

}<br />

}<br />

revprint(str);<br />

printf("%s ", s);<br />

int main()<br />

{<br />

char str[ARRAY_SIZE];<br />

printf("bir cumle girin : ");<br />

gets(str);<br />

}<br />

revprint(str);<br />

return 0;<br />

524

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!