This isn't perhaps the prettiest example but it serves your purpose. Be careful of the EOF. Best to avoid using it if you can.
Code:
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
/*
list.txt
-----------------
1,171.11
1,159.36
1,154.05
*/
fstream file_pointer;
file_pointer.open("list.txt",ios::in);
do
{
char array[81];
char barray[81];
file_pointer>>array;
int size = strlen(array);
int count=0;
int i;
for( i=0; i<size; i++)
{
if (array[i]!=',')
{
barray[count]=array[i];
count++;
}
}
barray[i-1]='\0';//get rid of the junk which may be present
float f;
f=atof(barray); //convert to float
cout<<f;//you can now perform standard maths on the number
//cout<<f*2;
cin.get();
count=0;
}while(file_pointer.peek()!=EOF);
file_pointer.close();
}