have a call to the ignore function before your getline so that the '\n' from the previous line won't be parsed by the getline function causing it to read nothing and thus throwing off your data >> age line
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char * argv[])
{
ifstream data("read.txt");
char * name = new char[256]; //same as char name[256]
int age;
char instr;
if(data.is_open()){
data >> instr;
data.ignore(1, '\n');
data.getline(name, 256, '\n');
data >> age;
cout << "instr -> " << instr
<< endl << "name -> " << name
<< endl << "age -> " << age;
}
else
cout << "could not open file";
cin.get();
return 0;
}