Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
videid
/
iax0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
57872619
authored
7 years ago
by
videid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lab14
parent
0a342774
master
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
0 deletions
lab14/lab14.c
lab14/lab14.exe
lab14/lab14.o
lab14/lab14.c
0 → 100644
View file @
57872619
#include <stdio.h>
#include <string.h>
int
main
(
void
){
char
s
[]
=
"azerty"
;
char
ss
[]
=
"azerty"
;
char
b
[
64
]
=
{
0
};
char
c
[
64
]
=
{
0
};
char
ch
[
1
]
=
{
0
};
char
*
p
;
char
arr
[
64
]
=
{
0
};
int
a
;
puts
(
"enter string for concatenation"
);
gets
(
b
);
while
(
getc
(
stdin
)
!=
'\n'
);
puts
(
"enter a string for 5th question"
);
gets
(
c
);
while
(
getc
(
stdin
)
!=
'\n'
);
puts
(
"
\n
enter one character for search"
);
gets
(
ch
);
a
=
strcmp
(
s
,
ss
);
if
(
a
==
0
){
printf
(
"starting strings are the same
\n
"
);
}
else
{
printf
(
"starting strings are different
\n
"
);
}
strcat
(
b
,
s
);
printf
(
"contatenated string is %s
\n
"
,
b
);
a
=
strlen
(
b
);
printf
(
"length of contatenated string is %d characters
\n
"
,
a
);
if
(
strstr
(
b
,
c
)
==
NULL
){
puts
(
"no same string found"
);
}
else
{
puts
(
"same string found"
);
}
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
];
}
else
{
}
}
puts
(
arr
);
printf
(
"modified function is %d characters long"
,
strlen
(
arr
));
}
This diff is collapsed.
Click to expand it.
lab14/lab14.exe
0 → 100644
View file @
57872619
File added
This diff is collapsed.
Click to expand it.
lab14/lab14.o
0 → 100644
View file @
57872619
File added
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment