cout<<00221

Please can somebody tell how to cout<< number like example 00844 if i want see 00 too, not only 844.
You can use array of char :
1
2
 char a[] = "00844";
 cout << a;

Last edited on
wouldnt than this number be like a symbol? After this can i do somethintglike this ----> a+1;
Maybe there is some formating commands to do it?
Last edited on
After this can i do somethintglike this ----> a+1;
- No;
Maybe there is some formating commands to do it?
- Yes;

http://www.cplusplus.com/reference/iostream/manipulators/setfill.html
Last edited on
Tnx man i will go try it :)
cout << "00844";
problem solved
1
2
#include <iomanip>
cout << setfill( '0' ) << setw( 5 ) << 844;
Topic archived. No new replies allowed.