hello i have a problem with converting a string of numbers to integer. the problem is that using atoi() to convert the string to integer i loose the leading zeros. can you please tell me a way to do that without loosing the leading zeros?
#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
struct Book{
    int id;
    string title;
};
struct Author{
    string firstName; 
    string lastName;
};
Author authorInfo[200];
Book bookInfo[200];
void load ( void )
{
    int count = 0;
    string temp;
    ifstream fin;
    fin.open("myfile.txt");
    if (!fin.is_open())
    {
        cout << "Unable to open myfile.txt file\n";
        exit(1);
    }
    while (fin.good())
    {   
        getline(fin, temp, '#');
        bookInfo[count].id = atoi(temp.c_str());
        getline(fin, bookInfo[count].title, '#');
        getline(fin, authorInfo[count].firstName, '#');
        getline(fin, authorInfo[count].lastName, '#');
        count++;
    }
    fin.close(); 
}
 
     
     
     
     
     
     
     
     
     
    