![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
14/10/2007, 12:41
|
| | Fecha de Ingreso: mayo-2007 Ubicación: PIC-16F84A
Mensajes: 729
Antigüedad: 17 años, 8 meses Puntos: 8 | |
Re: Detectar numeros en C Hola de nuevo. Estoe stá hecho con C++ Builder de la firma de Borland.
Código:
int TFP::leeBlancos(AnsiString linea, int pos){
bool enc=false;
int i=pos;
if((linea.Length()==i&&linea[i]==')')||linea[i]==';') return i;
while(i<linea.Length()&&!enc) {
if(linea[i+1]!=' ')
return i+1;
else i++;
}
return -1;
}
Código:
int TFP::leerNumero(AnsiString linea,int& pos, Simbolos finEx){
bool end=false;
AnsiString st_res="";
int i=pos,f=pos+1,res;
while(f<linea.Length()&&!end){
if(linea[f]!=' '&&!end){
end=esSim(finEx,linea[f]);
if(!end) end=esSim(operadores,linea[f]);
if(!end) f++;
}
else end=true;
}
for(int k=i;k<f;k++)
st_res+=linea[k];
pos=f;
res=StrToInt(st_res);
return res;
}
http://c.conclase.net/librerias/macro.php?mac=isdigit
Última edición por REHome; 14/10/2007 a las 13:44 |