I'm doing this little program in C++ but in codeblocks appears the following error: error:
'atod' was not declared in this scope
What I'm missing in this code? Thank you.
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <fstream>
#include <math.h>
#include <iostream>
using namespace std;
class birth{
};
int main (void){
int pass=1;
string date, boy, aux1, aux2, aux4;
double f;
while(pass=! 0){
cout<<"Enter the name of the birthday boy"<<endl;
cin>>boy;
cout<<"Enter the date of birth" <<endl;
cin>>date;
aux1= aux1.substr(5,10);
f= atod(aux1);
f=2012-f;
cout<< "The birthday boy "<<boy<<"who born"<<date<<"now have"<<f<<"years"<<endl
cout<<"Do you want to enter more birthdays?"<<endl;
cout<<"1.- YES"<<endl;
cout<<"2.- NO"<<endl;
cin>>pass;
}
system ("pause");
return 0;
};
EDIT: The problem is in this line:
f= atod(aux1);