Conversion from CString to int
-
Hallo
Kann mir jemand vertellen wie ich einen CString in ein int ungewabdelt bekomme???
Nadja
-
CString conc;
conc = "23323";
atoi(conc);
-
Macht er nicht
der kompiler sagt er kann kein CString in einen const char konvertieren
Nadja
-
Ich dachte du brauchst ein int ?
CString conc; conc = "23323"; int cstringalsint = atoi(conc);
-
oh ja
aber er ist mit dem wert innerhalb der klammern nicht einverstanden
der kompiler
-
Bitte ?
Poste mal deinen Source.
-
OK
mach ich aber achtung
es ist VC++ für Windows CENadja
-
und wo liegt das problem.
Ist ja auch c++;
-
int CMyMenuVisitorDlg::LookIndex(int index)
{
//###-- Sourcecode Begin
//------------------------//###-- Variable Declaration:-
int first ,last, nCount;
int ret=-1;CString namen,num,ind;
int count=myMenu->GetItemCount();
int itemIndexe[450];//###--select the index from the nameof the item and put it into an array
for (int i=0;i<=count;i++ )
{
namen=myMenu->GetMenuItem(i)->ToString();
first=namen.Find(_T("["));
last=namen.Find(_T("]"));
nCount=last-first;
num=namen.Mid(first,nCount);//hier das problem num muss ein int werden
num???
itemIndexe[i]=??;
}//###--look if the entered index is an Item Index
for (i=0;i<=count;i++ )
{
if(itemIndexe[i]==ind)
{
ret=i;
break;
}}
return ret;
//###-- Sourcecode End
}
den code komplett schicke ich dir
Mom
Nadja[ Dieser Beitrag wurde am 15.01.2003 um 14:22 Uhr von mimi_fifi editiert. ]
-
//hier das problem num muss ein int werden itemIndexe[i]=atoi(num);
[ Dieser Beitrag wurde am 15.01.2003 um 14:34 Uhr von Unix-Tom editiert. ]