python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Strange behaviour when implementing strcat in C
I'm trying to implement the strcat function myself. Here's my code:
char *my_strcat(char *dst, const char* src) {
char *tmp = dst;
while(*tmp) {
tmp ++;
}
while(*tmp++ = *src++...
pbbb
Votes: 0
Answers: 1
How to declare a variable using string concatenation and use that variable to print and integer defined as variable in C?
Getting output as 0 instead of defined value
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char *val;
char MODE_VAR[1000]="MODE0";
int MODE0_SE...
Gaurav Panchanan
Votes: 0
Answers: 0
indirect addressing problem about functions
strcat(s,t) copies the string t to the end of s,the following is initial code.
void strcat(char s[], char t[])
{
int i, j;
i = 0;
j = 0;
while (s[++i] != '\0');
while ((s[i++] = t...
neil guo
Votes: 0
Answers: 1
Why does this not concatenate two strings?
This is the requirement for my code:
This function appends the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and then adds a terminating null byte.
R...
Natnaelk
Votes: 0
Answers: 2