C question...

simos at athena.teiath.gr simos at athena.teiath.gr
Fri Feb 20 00:26:34 EET 1998



On Thu, 19 Feb 1998, Costas Vlassis wrote:

> 	Exoyme kai leme an exo ena string, poy 8elo na tiposo kai
> na einai "O kostas exei 500drx sti tsepi toy" o monos
> tropos na balo to "500" ekei einai o akoloy8os or not ?
> Prepei na yparxei kai pio efkolos-aplos!
> 
> i=500;
> strpcy(alfa, "O kostas exei ");
> sprintf(beta, "%d", i);
> strcat(alfa,beta);
> strcat(alfa,"drx sti tsepi toy");
> 
Kala to egraces, mporei na ginei omos kai:

int i = 500;
char my_str[] = "O kostas exei %d drx sti tsepi tou";
char buff[1024];	// 1024 just in case :)

sprintf( buff, my_str, i );

Simos KSenitellis

--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list