Hello all
I'm having difficulty with a program I am writing to reverse the characters in a string.
The string contains a sentence where i have to change a character...if it is lower case I have to change it to upper case and visa versa. And this has to be done using a function.
The problem I am having is that I am getting an error on my if statements.
error C2451: conditional expression of type 'void' is illegal
This is parts of my code
Any toughts or suggestions would be greatly appreciated
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
void upper_case(char[],int); // Function Uppercase Protocol
void lower_case(char[],int); // Function Lowercase Protocol
int main()
{
char in_put[] = "this is THE TiMe to gET thE CoRreCT ANSWERS.";
int *message;
printf("%s", in_put); // Print out original sentance
printf("\n\n");
while(in_put[a] !='\0')
{
if(upper_case(in_put, a)
if(lower_case(in_put, a )
printf("%s", in_put);
a++;
}
return (0);
}// end of Function main.
void upper_case(char message[], int a)// Function upper_case Definition
{
if(isalpha(message[a]))
if(islower(message[a]))
message[a] = toupper(message[a]);
}
void lower_case(char message[], int a)// Function lower_case Definition
{
if(isalpha(message[a]))
if(isupper(message[a]))
message[a] = tolower(message[a]);
}