vault backup: 2024-11-03 14:35:04
This commit is contained in:
parent
b434383ae8
commit
06fd14c57c
@ -55,6 +55,16 @@ strcat(str, "");
|
|||||||
|
|
||||||
> **9.** What will be the value of the string `s1` after the following statements have been executed?
|
> **9.** What will be the value of the string `s1` after the following statements have been executed?
|
||||||
```c
|
```c
|
||||||
|
// Assuming `str` is an empty string with enough space to store everything:
|
||||||
strcpy(str, "tire-bouchon");
|
strcpy(str, "tire-bouchon");
|
||||||
strcpy(&str[4], "d-or-wi")
|
// "tire-bouchon"
|
||||||
|
strcpy(&str[4], "d-or-wi");
|
||||||
|
// "tired-or-wir"
|
||||||
|
strcat(str, "red?");
|
||||||
|
// "tired-or-wired?"
|
||||||
|
```
|
||||||
|
|
||||||
|
Expected output:
|
||||||
|
```c
|
||||||
|
"tired-or-wired?"
|
||||||
```
|
```
|
Loading…
Reference in New Issue
Block a user