I am a beginning C programmer, having just reached the "Functions" chapter in my O'Reilly book Practical C by Steve Oualline. I have been assigned to make a program that replaces - with _. I have so far done this(note that some parts are not completed):
Code:
#include <stdio.h>
char inputstring[100];
char outputstring[100];
char minus;
char underscore;
minus=-;
underscore=_;
main()
{
printf("Input a string of words. Make sure to include a minus sign: ");
fgets(inputstring, sizeof(inputstring), stdin);
printf("\nTest: %s",inputstring);
char fun1();
}
There are no comments, and fun1 just means function one. Anyway, I know that I have to make a function that scans through the string inputstring, finds -'s, and replaces them. I have checked extensively through the internet, and I have not found one. That's maybe because I don't know how to look, but I would be extremely happy if someone could refer me to a website or give me a small amount of code(or a hint) on how to make this "scanning" function.

PS: Do I have to #include <strings.h>?

Thanks!

-StrikeMech