I'm a student. My code is skipping over my printString function when I run it. Pardon the poor spacing.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char * reverseString(char * original);
void printString(char * string);
int main()
{
char a[] = "this is a test \0";
char * b = a;
printString(a);
reverseString(a);
printString(a);
char * c = malloc(80 * sizeof(char));
printf("please enter a string:");
scanf("%79[^\n\t]", c);
printString(c);
char * d = reverseString(c);
printString(c);
}
void printString(char * string)
{
printf("hi");
printf("The string is %s\n", string);
}
char* reverseString(char * original)
{
char hold;
char temp;
char* end;
int i = 0;
while(original != '\0')
{
i++;
}
end = end +i-1;
while(end>original)
{
hold = *end;
*end = *original;
*original = hold;
end = end-1;
original++;
}
}