Hi everyone,

I'm writing a program that creates 2 structures, with the second having an instance of the first structure. I then create an instance of the second structure which the values are then in putted via the console, the program then creates a second instance of the second structure and copies all of the values from the user in putted structure.

My program copies all of the values just fine except for the string and the the double.
Can anyone spot any obvious flaws with my program?

Thanks a lot
Ryan

Code:
int main()
{
	struct Struct1
	{
		short int shortInt;
		long int longInt;
		char string[64];
		double floating;
	};

	struct Struct2
	{
		short int shortInt;
		long int longInt1;
		long int longInt2;
		struct Struct1 instance;
	};

	struct Struct2 My_Struct;

	printf("Please enter a short integer: ");
	scanf("%d", &My_Struct.shortInt );

	printf("Please enter a long integer: ");
	scanf("%d", &My_Struct.longInt1 );

	printf("Please enter a second long integer: ");
	scanf("%d", &My_Struct.longInt2 );
	
	printf("Please enter a short integer value, an instance of Struct1: ");
	scanf("%d", &My_Struct.instance.shortInt );

	printf("Please enter a long integer value, an instance of Struct1: ");
	scanf("%d", &My_Struct.instance.longInt );

	printf("Please enter a string, an instance of Struct1: ");
	scanf("%s", &My_Struct.instance.string );

	printf("Please enter a floating point number, an instance of Struct1: ");
	scanf("%f", &My_Struct.instance.floating );

	struct Struct2 My_Struct_2 = {
									My_Struct.shortInt, My_Struct.longInt1, My_Struct.longInt2,
									My_Struct.instance.shortInt, My_Struct.instance.longInt,
									My_Struct.instance.string[64], My_Struct.instance.floating
							     };

	printf("The values that were entered and copied are: \n%d \n%d \n%d \n%d \n%d \n%s \n%f \n ",
		My_Struct.shortInt, My_Struct.longInt1, My_Struct.longInt2,
		My_Struct.instance.shortInt, My_Struct.instance.longInt,
		My_Struct.instance.string[64], My_Struct.instance.floating);
}