Hey everyone, I'm writing a piglatin conversion program that works...however my teacher wants the basic cout instead of printf. I wrote my code using printf before I saw this in the notes but now whenever I try to change it over it produces an error. Any help is appreciated! I have highlighted the line
//This program will read in a string and then translate it into piglatin
#include<stdio.h>
#include<string.h>
#include<iostream>
usingnamespace std;
void PLC (char *x)
{
char *word = x;
while (word != NULL)
{
printf("%s%c%s", word+1, word[0], "ay "); //&&&&&&&&&&&&&&&&&&&
word = strtok(NULL, " ");
}
cout << ("\n\n");
}
int main ()
{
char input[1000];
char *token;
cout << ("Enter a Phrase to Be Translated to Pig Latin: ");
gets (input);
cout << ("\n");
token = strtok (input, " ");
PLC(token);
system("pause");
return 0;
}//End Main
I understand the syntax and how to use the cout statements, I just don't know how to fix line 14 so that when I run the program with cout it still works. Thats the problem I'm running into