What you seem to be wanting is if a specific character matches, replace that character with the specified symbol. Your last code did that correctly, meaning your if statement was correct. By using...
Type: Posts; User: kitsune3233
What you seem to be wanting is if a specific character matches, replace that character with the specified symbol. Your last code did that correctly, meaning your if statement was correct. By using...
Exactly. And if you don't know your compiler and system well enough to determine whether you should check it, chances are that you should probably be checking anyway.
Well, you're getting closer... :)
Farray[i] = ("%c", symb);
Farray[i] = ("%c", string1[i]);
What do those two lines do? Remember they're pretty much identical, so they behave the same way. ...
Actually, there's a very big problem with malloc() that you won't see with calloc(), though the problem isn't really a problem if you're not making your structs unusually large and you're not...
symb is a char, just like Farray[i] is a char. 1 is an int, just like 2 is an int. In other words, you should just be doing Farray[i] = symb (no functions needed to do that!) :)
Note that your...
There are numerous issues with your code, but your main problem is the fact that you didn't return a value from symbol() like you said you would. Also, you might find that your Farray array could be...
Aside from the preprocessor issue, what is the value of x? You didn't specify. In your code, you actually use testNeg(x) instead of something like testNeg(b). Maybe it was just a typo, but that...
Salem is correct. Depending on the material you're reading, you may see them more often than you might have expected. Anyway, it's really just the old way to define a function:
parse(buf, args)...
That's exactly the problem. Also, scanf() is generally abhorred due to various problems. See Question 12.19 of the C FAQ for an example of what WaltP was referrring to, and Question 12.20 for some...