when i m using this code: its not complete code..assume everything is right...
for(int result=0;result<g;result++)
{
u1+=((a[result].real_z1*tw[result])/sumd);
u2+=((a[result].imaginary_z1*tw[result])/sumd);
u3+=((a[result].real_z2*tw[result])/sumd);
u4+=((a[result].imaginary_z2*tw[result])/sumd);
}
cout<<"\n""Value of U1:"<<setiosflags(ios::scientific)<<setw(10)<<setprecision(8)<<u1;
cout<<"\n""Value of U2: "<<setiosflags(ios::scientific)<<setw(10)<<setprecision(8)<<u2;
cout<<"\n""Value of U3: "<<setiosflags(ios::scientific)<<setw(10)<<setprecision(8)<<u3;
cout<<"\n""Value of U4: "<<setiosflags(ios::scientific)<<setw(10)<<setprecision(8)<<u4;
ofstream abc;
abc.open("result.txt", ios::out | ios::ate);
abc<<endl<<endl;
abc<<"Data at position [ "<<i<<" , "<<j<<" ]"<<endl;
abc<<setiosflags(ios::scientific)<<setw(10)<<setprecision(8)<<u1<<" ";
abc<<setiosflags(ios::scientific)<<setw(10)<<setprecision(8)<<u2<<" ";
abc<<setiosflags(ios::scientific)<<setw(10)<<setprecision(8)<<u3<<" ";
abc<<setiosflags(ios::scientific)<<setw(10)<<setprecision(8)<<u4<<" ";
abc.close();
I am getting several errors like:
1>c:\tcwin45\bin\finalpro.cpp(126) : error C2653: 'ios' : is not a class or namespace name
1>c:\tcwin45\bin\finalpro.cpp(126) : error C2065: 'scientific' : undeclared identifier
1>c:\tcwin45\bin\finalpro.cpp(126) : error C3861: 'setiosflags': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(126) : error C3861: 'setw': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(126) : error C3861: 'setprecision': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(127) : error C2653: 'ios' : is not a class or namespace name
1>c:\tcwin45\bin\finalpro.cpp(127) : error C3861: 'setiosflags': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(127) : error C3861: 'setw': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(127) : error C3861: 'setprecision': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(128) : error C2653: 'ios' : is not a class or namespace name
1>c:\tcwin45\bin\finalpro.cpp(128) : error C3861: 'setiosflags': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(128) : error C3861: 'setw': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(128) : error C3861: 'setprecision': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(129) : error C2653: 'ios' : is not a class or namespace name
1>c:\tcwin45\bin\finalpro.cpp(129) : error C3861: 'setiosflags': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(129) : error C3861: 'setw': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(129) : error C3861: 'setprecision': identifier not found
1>c:\tcwin45\bin\finalpro.cpp(131) : error C2065: 'ofstream' : undeclared identifier
1>c:\tcwin45\bin\finalpro.cpp(131) : error C2146: syntax error : missing ';' before identifier 'abc'
1>c:\tcwin45\bin\finalpro.cpp(131) : error C2065: 'abc' : undeclared identifier
please help me to solve it...