Check to make sure your test.txt file is actually being created. Usually in the root directory on a drive, you need admin access to create a file -- which your program probably doesn't have. So creating the file is failing in your input function. Then when you try to read the file, you fail, which fills your vars with 0 when you try to read.
Try getting rid of the absolute path, here. Just save/load "test.txt" instead of "e:/test.txt"
Also, depending on the way the compiler handles failed stream input, the previous values stored in amount and name may remain, thus if the file access fails completely, the apparently correct output might be printed. you can check for this,
45 46 47 48
if (my)
cout << name << " "<< amount;
else
cout << "File input error";