python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Using strcpy on a 2D char array allocated with malloc
I have a problem, and I cannot figure out the solution for it. I have to programm some code to a µC, but I am not familiar with it.
I have to create an analysis and show the results of it on the scree...
MrByte
Votes: 0
Answers: 2
strcpy() corrupts both strings if first argument is a char pointer
Define the following variables:
char *name1 = "Allan";
char name2[] = "Marco";
printf("%s %s\n", name1, name2); // Allan Marco
Then the following code works fine:
strcpy...
Ivan
Votes: 0
Answers: 2
String concatenates with another after strcpy for the latter
As you can see in my code bellow I don't mess with e[i].politico in the for cycle where my problem occurs, but for some reason, after perfoming a strcpy onto e[i].risco of a predifined char array, e[i...
Gomes
Votes: 0
Answers: 0
strcpy crashing program
I creating a program which imports date and time entries (eg. 29/11/2021-15:33:56) from a file and stores them in an array. We are asked to then create a function (timeStampToSeconds) to convert thes...
Cik02
Votes: 0
Answers: 1