4
In function main
when I print a char
, it appears a strange code like a hexa:
But when I print the same char
in another function it appears normal.
char tempA[100] = "1111";
int main () {
strcpy(tempA , "11");
printf("\n\n ) ====> tempTestA = %s \n\n", tempA); // aqui NAO funciona, EXIBINDO APENAS CARACTERES estranhos..
outraFuncao(tempA);
}
int outraFuncao(tempA)
{
printf("\n\n ) ====> tempTestB = %s \n\n", tempA); // aqui NAO funciona, EXIBINDO APENAS CARACTERES estranhos..
strcpy(tempmais , "11");
printf("\n\n ) ====> tempTestB = %s \n\n", tempmais); // aqui funciona bem..
//restante da funcao...
}
And if I call the job outraFuncao()
with some parameter, it also shows in the values, only strange characters.
What could I be doing wrong?
Apparently the title does not match the problem presented. Which problem you want to solve?
– Maniero
And if I call the function "otherFuncao()" with some parameter, it also shows in the values, only strange characters. What I might be doing wrong?
– Roberval Sena 山本
The ideal is to put a real code you are using. The question is extremely confusing and only got worse with this comment.
– Maniero
but that’s the real code...
– Roberval Sena 山本
eu chamo a função "outraFuncao()" com algum parâmetro
your sentence, the code doesn’t do it. If it’s the real code, the comment doesn’t make sense.– Maniero
sorry bad way, I think I’m not able to ask the question... but I edited the post, I hope to be clearer..
– Roberval Sena 山本
In fact, it only got worse, because the code doesn’t match the statement, the body doesn’t match the title that would make sense if the rest of the text matched the last statement. Anyway I answered what the title asks, rearranging the code to show you the right way to do and fixing the printing problem. There may be some other problem, but the code doesn’t show it. Still the code of my answer is the complete solution.
– Maniero
I found it curious that the code has several errors to the answers that only correct one of them has more votes than mine that corrects all errors.
– Maniero
for eh... I am confused .. . too much...
– Roberval Sena 山本
Hello @bigown, (I edited the post) and made the corrections that Oce suggested! but the problem persists... when I call otherFuncao(tempa); and print to the screen .. errors continue.. can give me a touch?
– Roberval Sena 山本
You didn’t do everything I said. Did you see that mine is working? Click there on ideone to see? Anyway you can’t keep changing the question. Question asked, question answered. If you have another problem, another question must be asked. But before you do another need to follow what I said, you’re doing something else, it won’t even work. To tell you the truth, only a bad compiler will compile this code. You fixed what the other answers said, mine solves all problems. I proved it.
– Maniero
Okay, let me review! I’ve definitely screwed up here! Thanks for the patience! This is learning and with an avalanche of information!! rrsrs !
– Roberval Sena 山本
thanks!!! I realized what I was doing wrong!!!! Thanks!! our... how to study tires tires!!!
– Roberval Sena 山本