Skip to main content

All Questions

-4 votes
1 answer
79 views

I don't get the problem. The following program contains an error. Indicate it, and indicate what the function does and what the main prints [duplicate]

I know that the program should put string2 and string1 after the string3, but I don't know where the problem is. #include <stdio.h> char* f(char *p1, char *p2, char *p3) { char* tp1 = p1; ...
Isidoro D'arco's user avatar
0 votes
2 answers
88 views

Concatenating two strings but getting null. please pont me error in this

I am trying to copy two strings to a new pointer. this is to concatenate string pointer with sub pointer. Trying to make the output in new pointer str .what is wrong in this? void addsubstring( char* ...
user avatar
1 vote
2 answers
81 views

C++ program not returning a Value (Functions)

I want to write a program, to create a function that concatenates two strings to form a single string. However, my program is not returning any value. #include <iostream> #include <cstring>...
Agitated_Mouse's user avatar
1 vote
3 answers
228 views

Memory leak in a join string function

I'm trying to make a function that join 2 strings (str1 & str2) into a new one (str3) seperated by a char seperator. Unfortunately I have a memory leak from this function and I don't really know ...
Arthur Btrd's user avatar
1 vote
3 answers
104 views

Undefined behaviour whist concatenating strings in C

I'm writing a C program that would concatenate all the lines ("\n" included) whilst saving the pointer to the last character of the final string. However, I do not get the result I expected. ...
Kevin's user avatar
  • 203