Hi, iam writing a pig latin program with 3 different methods
i dont knw understand the error that iam gettin in the code
here's the code:
#include <stdio.h> /*Include the standard I/0 header file */
#include <string.h> /*Include the standard I/0 header file string library */
//The functions that are meant to be defined
char* toPLString(char * inputstring);
int getInputBygetChar(char input[]);
int getInputByfgets(char input[]);
int getInputByscanf(char input[]);
int main(int argc, char *argv[]){
char phrase[1000];
char *token;
printf("%s", getInputByscanf);
printf("The sentence in Pig Latin is: ");
token = strtok(phrase, " ");
toPLString(token);
printf("\n");
system("Pause");
return 0;
}
//method to convert to Pig Latin
char* toPLString(char * inputstring){
char *toPLString = inputstring;
while (toPLString != NULL){
printf("%s%c%s", toPLString + 1, toPLString[0], "ay ");
toPLString = strtok(NULL, " ");
printf(" ");
}
}
//Method to to read a string from keyboard and return number of characters read.
getInputBygetChar(char input[]){
}
//Method that uses the fgets method to read a string from keyboard and return number of characters read.
int getInputByfgets(char input[]){
}
/*Method that uses the scanf method to read a string from keyboard and return number of characters read.
*Scanf reads a character string. The scan terminates at whitespace. A null character is stored at the end
of the string. However, the input string size from a user is arbitrary.*/
int getInputByscanf(char input[]){
char phrase;
printf("\nEnter the phrase to translate: ");
scanf("%s", &phrase);
return 0;
}
i dont understand y its giving me the address output, i need to implement this method correctly, can some1 help me plzz...