|
for example:
cout << setw(3)<<kk<<left<<setprecision(2)<<name<<endl;
but the output is still as follows:
1 jok
2 nice
.
.
.
10 mike
actually here name mike has same line with nice, jok..but mike is further front...
another question is setw(3), also couldnot work properly..no space display
Li Zhiyuan
|
|
|
|
|
If I understand your requirements then you probably need:
cout << right << setw(3)<< kk << " " << left << name << endl;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
thanks, i did like this before, could you provide me with detail step by step, thanks a lot. in vc++ 2005 format.
Li Zhiyuan
|
|
|
|
|
I posted a line of code. What details and steps do you need about?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi..
Just wanted some info on ways to automate VC++ builds. I am using Visual Studio .NET 2003.
Maybe some command line switches of devenv.exe ?
Regards
Amit
|
|
|
|
|
|
Thanks a ton Haroon! I was able to do my job
|
|
|
|
|
cagespear wrote: Just wanted some info on ways to automate VC++ builds.
Maybe some command line switches of devenv.exe ?
Yes. Thats the easiest way to go.
Alternatively, you could use a totally different build system like Microsofts nmake, scons or jam.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
As you mentioned it, have you ever got Jam to work? I tried it for building the Boost library and couldn't get anywhere with it. Do you perhaps know of any good tutorials for it?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: As you mentioned it, have you ever got Jam to work?
Actually, no.
But it pops up in every review on build systems.
We used SCONS, and it worked.
Now, we are more and more switching to .NET and NANT.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Thanks, I'll check out SCONS at some point.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
You know this review[^]?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Nice article, thanks. I guess I'm not the only one who's had trouble with Jam then. Unfortunately I hate and am hopeless with make as well which is really disabling me from doing proper cross platform development. I guess I'm going to have to spend some time with a hefty make tutorial and write my own front end...Hmm XML to make using a recursive decent parser ... Visual Studio solution to platform indpendent XML using XSLT ... Visual Studio AddIn to export ... GCC build for MinGW ... next time I've got a spare month
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Wow! You have given a lot of stuff to read/know about, thanks dude!
|
|
|
|
|
hi
i have a application when i click the close button(X) , it must goes to the tray but it should be running ...
(i did a project when i click minimize button(_) it goes to tray . it is perfectly working)
k.guru moorthy
|
|
|
|
|
Have you tried to handle the WM_CLOSE event and write your code to send your application to tray there?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi,
I have a modal dialog with two edit boxes, one of them read-only, and a button. I want to transfer the integer written into the first to the second when the button is pressed.
I have added variables(int iVar, iCalcValue) to the edit-boxes and an event handler to the button, but I don't know where and how to write the data update code so the value is shown on the screen.
Sorry for such a silly question, I'll get better after some time
Thanks
|
|
|
|
|
Call UpdateData(true) before you read value from the control and update the member variable. Call UpdateData(false) before you update the control on the screen to reflect the value of the member variable.
UpdateData(true);
m_edit2 = m_edit1;
UpdateData(false);
Remember that UpdateData() will update the state of every other control and member in your dialog as well.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
modified on Tuesday, February 12, 2008 4:49 AM
|
|
|
|
|
In the button event handler, call
(1) UpdateData(TRUE);
to assign to the variable iVar the (numeric value corrensponding to) edit box text.
Then set:
(2) iCalcValue = iVar;
and, finally, call
(3) UpdateData(FALSE);
to set the edit box text according to iCalcValue .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks guys, I really appreciate it.
I'll come back with something more difficult next time
|
|
|
|
|
Hi guys can any one tell me whether there is an inbuild function that converts hexa value to decimal.
I have used sscanf(charVar,"%X",intVar) when I do this the output is same as that of input (i.e., same hexa value). can any one help?
Regards,
lgatcodeproject
|
|
|
|
|
lgatcodeproject wrote: converts hexa value to decimal.
That doesn't really make sense to me. A value is a value, it's only a representation of that value that can be decimal or hexadecimal. In your sample, you have a string that contains a hexadecimal representation of a number and you store that value in the intVar. But at this time, it is a value, and not a representation anymore. There is no output possible of your intVar (if you look at it from your debugger, the debugger will show you a representation of the number, which you can change without affecting the value).
I would have guessed that you want to convert a string that contains a hexa representation to a string that contains a decimal representation but your code snippet contradicts that.
So, what are you trying to do exactly ?
|
|
|
|
|
Hello,
Consider this situation, I need to iterate 'iLength' number of values for a business logic. 'iLength' is a value represented in hexa. In a while loop, to perform a boundary check I am using this 'iLength' value.
while(++iPosition<= iLength)
My assumption is that this boudary check requires the value to be an integer is not so? If not clarify?
Assuming my assumption is true how do I represent a hexa value in decimal?
eg. if 'iLength' = 2b, I need 'iLength' to contain 43? How ?
Kindly clarify. Thanks for your quick response.
Regards,
lgatcodeproject
|
|
|
|
|
lgatcodeproject wrote: eg. if 'iLength' = 2b, I need 'iLength' to contain 43? How ?
You have to do nothing, supposing iLength is declared as an integer variable.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
If iLength is an integer (which I suppose), it IS a number. iLenght contains your value and it has nothing to do with "2b" or "43" because these are only representations of your number. You have to make the difference between the value itself (which not hexa, decimal or whatever, it is just a value) and how you want to represent it (which is only used if you want to print the value in a string).
Do you understand the difference ?
lgatcodeproject wrote: 'iLength' is a value represented in hexa
That doesn't make sense: iLenght is an integer and that's it. An integer is never represented. If you look at it from your debugger, that's because your debugger is configured to display a representation of it in hexa, but you can change the representation to decimal without affecting the value at all.
|
|
|
|