Ok cant get my head around this one :/
But basically i need to write a program that accpets input from a keyboard "JACK ROBINSON" then it manipulates the string to output INK SON ROB JAC...
Heres what i have so far:
#include <stdio.h>
#include <string.h>
void main()
{
char *FullName="JACK ROBINSON";
char *Input;
char *Word1, *Word2, *Word3, *Word4;
do
{
printf("Please enter JACK Robinson: ");
scanf("%s", Input);
if(strcmp(Input,FullName)==0)// Checks to see if user entered "JACK ROBINSON" correctly
{
strncpy(Word4,FullName,3); // Copies JAC to Word4
Word4[3] = '\0';
//rest of manipulation to go here
}
else
{
printf("Please Try Again\n");
}
}
while (strcmp(Input,FullName)!=0);
}
Now atm it crashes when i type in JACK ROBINSON or any incorrect data... any ideas why its doing this and also how to get the 3 other answers by manipulatin the string?
Many thanks,
Mark Hebden