I have this simple C code: compiled as: and executed as: prints: Why yyy is not printed? By reducing the issue I've found that: for s ...
I have this simple C code: compiled as: and executed as: prints: Why yyy is not printed? By reducing the issue I've found that: for s ...
The following code below runs without a seg fault when I switch the code to so I receive a seg fault and am forced to switch my node property da ...
Let's say I have an array that looks like: char arr[MAX_ARR_LENGTH][30] = {"Tom", "and", "Jerry" }; Now, how do I append a new string that the end ...
I programmed an example on my Win64 PC with code:blocks using strcpy_s and strcat_s. The program works, but I get the warning messages "warning: impli ...
char getString(char *str, int length, char field[20]) { printf(" %s: ", field); fflush(stdin); fgets(str, length, stdin); str[strlen(s ...
Code I have this simple code of mine , all i want to do is add them together, but whenever I use strcpy_s or strcat_s it gives this error in the pi ...
I made a function to copy string t to string s using pointers from K&R. The while loop uses (*s = *t)!='\0' which is supposed to mean that to ru ...
I just started C++ and now I'm making a simple program. But don't know how to fix this problem. I'm not a native english speaker so some sentences may ...
Why pointer to custom struct doesn't work in that code? Why I'm getting warning in that line with p->x = x? Why I'm getting second warning i ...
char* argv[MAXARGS]; char* buf2=malloc(MAXLINE * sizeof(char)); strcpy(buf2, buf); //buf is string with some words char* ptr = strtok(buf2, " "); ar ...
I do not understand. The string as it is declared should not be read only right? Why cant I change it? ...
In the output, there is only water is printed, but no soda is printed. But in my opinion, soda has less size, it should be easily saved in x because x ...
I have a homework where i need to read from a file and save in arrays informations like the city name, the country code, the county name and the popul ...
i am currently learning cs50. i am currently studying data structures..i came across a problem...please see if you could help: ...
I'm trying to implement a function that copies characters from the c string source and then stores it into the array destination. I know this is strcp ...
for example, Does this copy 1 * 5 bytes, plus 1 more bytes of the \0 null terminator? So 6? Im pretty new to low level, so I'm struggling to under ...
In the Ritchie/Kernighan book, they show a few ways how to create a self made strcpy function, one of them is with using array subscribed instead of c ...
I am trying to copy the value of argv[i] (which is a string) into a char array x[10] by using strcpy(). Code: output ...
. There are disputes about this question’s content being resolved at this time ...
I tried to limit the number of n bytes copied to dest (here str1) by using strncpy(). The dest is big enough for the n bytes, but the output produced ...