|
hello for all
please help me
i have
char x[50]="int w ; int s,get;";
i want to divide this string as
w
s
get
then i want to store each of them as example
string s[8];
s[1]=w
s[2]=s
s[3]=get
i can store it
i can't divide it, i have some ideas but didn't execut
please help me
|
|
|
|
|
sofia_111 wrote: i can't divide it, i have some ideas but didn't execute
What was your idea? Can you show us what you tried?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
int o=0;
for( int h=0 ;h<l ; h++)
if(str_integer[h]==' ' || str_integer[h]==',')
{
o=h+1;
if(str_integer[o] !=',' || str_integer[o] !=';')
{
cout << str_integer[o] <<'\t';
o++;
}
}
l is maximum number of str_integer
this excuted put print only the first character
i want print all character between , and ; or between space and , or between ,and,
in lgical we must use while not use if but when I use while appeare problem in excute
THANKS THIS MY IDEA
I HOPE HELP ME
modified on Tuesday, May 6, 2008 4:32 AM
|
|
|
|
|
Have a look strtok , see the sample in the related MSDN page [^].
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
|
|
|
|
|
is there any way without strtok ?
|
|
|
|
|
Of course it is: you may choose a lower level approach (hand crafting) or a higher level one (for instance expoiting some string class's methods or a regular expression library).
But why?
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
|
|
|
|
|
You basically need to build a (very simple) lexical analyzer [^], thought in your case it should not be such a daunting task, maybe reading some introductory material about will be helpful.
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
|
|
|
|
|
How to create a TreeControl on a ListControl ?
|
|
|
|
|
Search Google for Tree List Control.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
have a look here[^] too, or ask codeproject search engine
|
|
|
|
|
|
I need to know how to show the progress bar in staus bar,i read the one said by Chris Maunder,but wasn't able to understand that,can anyone say the steps involved in doing that in a more elaborate way????
RAJA
|
|
|
|
|
Hi,
use the GetItemRect API to get the rectangle of a pane in which u wanted to place your progress bar.Set the status bar as the parent of the Progress bar.
To implement this u can either derive a class from CStatusbar and on the OnCreate function place the code for progress bar creation or u can place the code on the OnCreate function of your main window.
thanks
Nitheesh
|
|
|
|
|
Project RAJA wrote: I need to know how to show the progress bar in staus bar,
Here is a simple function which does this. This function assumes both progress and status bars are created!
void CProcessViewerDlg::SetUpProgressBar()
{
if( !m_StatusBar.GetSafeHwnd() || !m_PrgCtrl.GetSafeHwnd() )
{
return;
}
CRect crPaneRect;
m_PrgCtrl.SetParent( &m_StatusBar );
m_StatusBar.GetStatusBarCtrl().GetRect( 1, &crPaneRect );
crPaneRect.DeflateRect( 0, 2, 2, 2 );
m_PrgCtrl.MoveWindow( crPaneRect );
}
This sample is taken from my ProcessViewer application -> http://www.codeproject.com/KB/cpp/processviewer.aspx[^]
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
there are so many good articles over Codeproject, why do people don't spare some little time to seek them ?
|
|
|
|
|
Lazyness? :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
indeed, my post was telling : "search, don't ask, lazy monkey !"
|
|
|
|
|
I created a workplace, in the project there were some projects. Some of the projects were librarys to be used by some other projects. In another word, there were some projects depending on other projects in the same workplace.
The problem is, how to set the projects which were dependent on other projects, so that, when I want to link or compile them, their dependencies would be linked or compiled first?
Thanks
|
|
|
|
|
For VC6 I don't remember exactly where it was but you have to look for "Project Dependencies". I think you can right-click on a project and then in the pop-up menu you'll have that option.
Once you have found it, you simply specify which other projects in the workspace your specific project depends from. Then, the build order will be automatically updated.
|
|
|
|
|
OK. I got it. In fact, I use VC2005 but VC6, I quested for one of my friends.
It's so simple, only select the "project" menu, then the "dependencies" sub-menu.
Thanks very much.
|
|
|
|
|
how can we implement CSpinButtonCtrl with float values?
|
|
|
|
|
See CNumSpinCtrl[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
i want to show different values to an edit bix when my program is running. right now i m generating the valuses but i am only able to show the last value that i generated.i used Updatedata(FALSE)-it only passes the last value that i generate inside my code.
i need to solve this. hopefully there are expaert gyus who can help me.
thanks,
shohel ahmed
|
|
|
|
|
What do you mean by you want to show different values in an edit box? Are you wanting to show everything together? And can you show us your code? How are you generating values and what exactly do you want to show in the edit box?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|