yup
Femtopat
- Katılım
- 22 Ocak 2022
- Mesajlar
- 8
Daha fazla
- Cinsiyet
- Erkek
Kisaca fonksiyonun bunu yapması gerekiyor:
İlk cümle: "merhaba hava? Çok güzel.."
Yeni cümle: "güzel.. Çok hava? merhaba"
Bunu yapmaya calistim ama hiçbir fikrim yok ve tıkandım. Tersten for loop falan denedim ama pointerlar bayağı kafamı karistirdi.
This function takes a pointer to a Source ('src') string (an array
Of chars, with maximum size MAX_STR_LEN), and
Makes a New string Inside the destination ('dest') string
(Which is also passed as a pointer) so that the order
Of the words in the destination string is the reverse
Of the order in the Source string.
The only character to be used in separating words is
A blank space, so any other characters are considered
Part of a Word,
İlk cümle: "merhaba hava? Çok güzel.."
Yeni cümle: "güzel.. Çok hava? merhaba"
Bunu yapmaya calistim ama hiçbir fikrim yok ve tıkandım. Tersten for loop falan denedim ama pointerlar bayağı kafamı karistirdi.
C:
///// DO NOT USE the string library <string.h>
#include<stdio.h>
#include<stdlib.h>
#define MAX_STR_LEN 1024
/////////////////////////////////////////////////
void reverse1(char *dest, char *src)
{
//int n=0, i;
//for(i=n-1;i>=0;i--){
//while (src[i]!=" '&& j>=0)j;
}
}
This function takes a pointer to a Source ('src') string (an array
Of chars, with maximum size MAX_STR_LEN), and
Makes a New string Inside the destination ('dest') string
(Which is also passed as a pointer) so that the order
Of the words in the destination string is the reverse
Of the order in the Source string.
The only character to be used in separating words is
A blank space, so any other characters are considered
Part of a Word,