I understand... so 0 is used to specify the pad when you put just the width, right? like "%03d". When you use width.precision, the precision of the integer will be always padded with 0s...
So,...
Type: Posts; User: RLeePlusPlus
I understand... so 0 is used to specify the pad when you put just the width, right? like "%03d". When you use width.precision, the precision of the integer will be always padded with 0s...
So,...
I said that i tried it, and get answers like yours is over the top...
1 - I read the documentation before i post this question and i read it again when you said to. specifically on the width it says:
widthdescription
(number)
Minimum number of characters to...
man, you really S U CK S... telepatic? Its not about to accept and use! Its about WHY IS DIFFERENT or IS REALLY DIFERENT? What a stupid reply... leave this for who want to discuss. You should be...
Why it doesn't matter in VS 2010? in GCC/GPP i have to put the 0?
i still got the same results, with or without the '0' preceding the width... Just for information, i'm using VS2010 express
thank you
i have tried with this:
sprintf(msg, "Teste %02.2d",100);
sprintf(msg, "Teste %02.2d",100000);
sprintf(msg, "Teste %02.2d",100000000);
Like what? i tried others too but with or without 0 (2.2 / 02.2) i got the same result. this is not a homework or something that i want you to do for me... If i'm asking here is because i really want...
Hi!
i dont know what is the difference between the 2 masks (the result
on visual c++ 2010 is the same):
sprintf(msg, "Number %2.2d",10);
sprintf(msg, "Number %02.2d",10);
Thx for suggestions laserlight, i just have one more question...
if i make a constructor in the struct, it will affect the result of sizeof(struct)???
thank you!
i forgot to say that the stInfo will be inserted into a vector of stInfo's... So it have to be a stInfo. And when i say tags i mean ID's like "001" or "002". It will be easier to do if a just cast...
I see... The idea was cast and then evalue in the struct fields, using they sizes and etc... Its really not safe to do this?
i will use the first field to identify a tag and then according to the tag process the other fields. Its just a way to separate things to process.
Hi there,
So i have a struct:
struct stinfo{
char info1[19];
char info2[5];