Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Usage

Status
Not open for further replies.

juanvelas

Programmer
Apr 22, 2001
5
0
0
CO
Hi.
Is this code correct?
is in spanish but not to worry!!!
long memoria::swaplibre()
{
long cantidad=0;
long NroPaginas;
NroPaginas = ((MAX_MEM/5)/1024);
long contador=0;
long multiplicador=1;
while (contador<=NroPaginas)
{
//Is this correct? the array is declared
//as follows: char swap[MAX_MEM]
char *textoswap;
textoswap=swap[contador] + &quot;&quot;;//HERE!!!!!
if (strcmp(textoswap, &quot;/O&quot;)==0)//HERE!!!
{
cantidad++;
}
contador = multiplicador*5*1024;
}
return(cantidad);
};

Thanks
Juan Velasquez
correo@runbox.com
 
<
< textoswap=swap[contador] + &quot;&quot;;//HERE!!!!!

This is wrong. You should have String class object in this case.
And where is your initialization of swap array ?
What are you comparing there ?

Best Regards,

aphrodita@mail.krovatka.ru {uiuc rules}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top