Commit 08f78bac by videid

lab14

parent 57872619
Showing with 19 additions and 8 deletions
#include <ctype.h>
#include <stdio.h>
#include <string.h>
......@@ -9,11 +9,13 @@
int main(void){
char s[] = "azerty";
char ss[] = "azerty";
char sss[] = "azerty azerty";
char b[64]={0};
char c[64]={0};
char ch[1]={0};
char *p;
char arr[64] = {0};
char arr2[64] = {0};
int a;
puts("enter string for concatenation");
gets(b);
......@@ -40,19 +42,28 @@ int main(void){
else {
puts("same string found");
}
char *e;
for(a=0;a<strlen(b);a++){
printf("\n%s",strstr(&b[a],&ch[0]));
if (strstr(&b[a],&ch[0])== NULL){
arr[a]=b[a];
*e = b[a];
if (strstr(e,&ch[0])== NULL){
strcat(arr,e);
}
else{
}
}
puts(arr);
printf("modified function is %d characters long",strlen(arr));
printf("modified function is %d characters long\n",strlen(arr));
char k;
for(a=0;a<strlen(sss);a++){
k = sss[a];
printf("\v"); //the \v isn't displaying anything on my compiler but when i change it to \n it shows my code is working
if (isspace(k)){
}
else{
printf("%s",&k);
}
}
}
......
No preview for this file type
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment