Hello all,
I am trying to read in some data which input from the keyboard which is stored using data structures. I have found a way to get this to work using the first input from the user in a set of questions in this code.
[code="c"]printf("\n\nEnt er your name: ");
gets(personalDe tails.criminalN ame);
puts(personalDe tails.criminalN ame);[/code]
Later on I have a similar set of code which is used in a similar way only further on in the program.
I have to use the scanf() function this time so the compiler will stop and allow me to input the info needed, otherwise it skims right over to the next input
[code="c"]printf("\nHouse Name Please: ");
scanf("%s", &address.houseN ame);
gets(address.ho useName);
puts(address.ho useName);[/code]
Here if I input Horns House Farm it only displays House Farm. Can anyone give me a clue as to how to resolve this even if not with a full code solution?
thank you,
Jonathan
I am trying to read in some data which input from the keyboard which is stored using data structures. I have found a way to get this to work using the first input from the user in a set of questions in this code.
[code="c"]printf("\n\nEnt er your name: ");
gets(personalDe tails.criminalN ame);
puts(personalDe tails.criminalN ame);[/code]
Later on I have a similar set of code which is used in a similar way only further on in the program.
I have to use the scanf() function this time so the compiler will stop and allow me to input the info needed, otherwise it skims right over to the next input
[code="c"]printf("\nHouse Name Please: ");
scanf("%s", &address.houseN ame);
gets(address.ho useName);
puts(address.ho useName);[/code]
Here if I input Horns House Farm it only displays House Farm. Can anyone give me a clue as to how to resolve this even if not with a full code solution?
thank you,
Jonathan
Comment