72 italiano Posted June 28, 2008 at 01:42 AM Report Share #194233 Posted June 28, 2008 at 01:42 AM boas.. uma duvida.. ha alguma forma de guardar printf's para posteriormente trabalhar com os resultados, sem termos que os colocar num ficheiro ?? obrigado Link to comment Share on other sites More sharing options...
TheDark Posted June 28, 2008 at 03:22 AM Report Share #194240 Posted June 28, 2008 at 03:22 AM podes fazer um sprintf idêntico ao printf que fizeste para guardar o resultado num array de char: int x=1, y=2; char str[100]; printf("Olá mundo! A variável x tem o valor %d e a y tem o valor %d", x, y); sprintf(str, "Olá mundo! A variável x tem o valor %d e a y tem o valor %d", x, y); str fica com a string formatada igual à que aparece no ecrã. Desaparecido. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now