Linked Questions

1 vote
1 answer
33k views

I'm Trying to do some simple c programming that will return the char value. The program is running with no error but, the output of the expected string does not appear. What I expected it will return ...
Wan Afifi Wan Zain's user avatar
0 votes
1 answer
3k views

How can i return a string for work with? I dont know why this function arent working. #include <stdio.h> char* test(){ char A[100]; scanf("%s", A); printf("A = %s \n", A); return(A)...
juanjpnv's user avatar
-1 votes
2 answers
3k views

Recentely I've been taking the CS50 2020 course from Harvard University as an introduction to C programming. I'm not very experienced with the language or with coding as a whole, so I'm struggling a ...
PedroBinotto's user avatar
0 votes
0 answers
476 views

I would like to know how can I return a string in c and then send it as a parameter to another funcion. For example, in those functions: This is the function that returns a char *: char * read(){ ...
kalia's user avatar
  • 219
-4 votes
2 answers
334 views

I've made one C++ program using pointers and functions to return the reverse of a string. When the range char p[] in the function rev is low like 25 (less than. 145), the output is like ►↕☻ ☺♠♥, it ...
Tuesday's user avatar
  • 55
0 votes
1 answer
124 views

So, I'm trying to return a string from a char* function but I always get this warning: function returns address of local variable [-Wreturn-local-addr], and the string doesn't print to the console. ...
Ricardo Sampaio's user avatar
1 vote
2 answers
141 views

I am really trying very hard to figure out how to return string from a function to other. Please help me to solve this problem. Returning Password as String from this function: char* password(void) ...
Manas Swain's user avatar
0 votes
0 answers
50 views

I am trying to have one function pass an string into a string like this: char taBortTecken(char inputString[]){ //antalBokstaver-1 make sure the string is just the right size. This is working ...
J. Doe's user avatar
  • 375
1 vote
0 answers
49 views

I am trying to build a function that concatenate two strings and return the concatenated string here is my current code const char *myName(); int main(int argc, char *argv[]) { char *myname = ...
A.Nassar's user avatar
0 votes
0 answers
46 views

I am quite new in C so I could not fix it. The code below should take a char array (called Rawpack) and getthesign method should return the 10-19 indexed elements of that array. In python I did it ...
ReduX Completedy's user avatar
0 votes
0 answers
39 views

char *_strreverse(const char *str1){ if (str1 == NULL){ return NULL; } char str[strlen(str1)]; strcpy(str,str1); for (int i = 0; i < strlen(...
игорь кочнов's user avatar
145 votes
15 answers
416k views

I am trying to return a C string from a function, but it's not working. Here is my code. char myFunction() { return "My String"; } In main I am calling it like this: int main() { printf("%s", ...
itsaboutcode's user avatar
  • 25.2k
0 votes
2 answers
11k views

I'm trying to generate 3 address code corresponding to basic arithmetic expressions. I haven't worked with lex and yacc tools before much (Newbie) and I'm having trouble understanding the flow of ...
Swagnik Dutta's user avatar
0 votes
3 answers
1k views

I'm trying to use a for loop to go through two strings character by character and see where they are equal, where they are different, and if so if both are letters than I do one condition, but if one ...
Tom Rodgers's user avatar
1 vote
1 answer
2k views

I have created the two following functions. The first, eatWrd, returns the first word in a string without any white spaces, and removes the first word from the input string: MAX is a number ...
quigs's user avatar
  • 23

15 30 50 per page