jeudi 20 avril 2017

Replace printf with cout statements

I'm trying to write a script which could inline replace a printf statement with the cout statement. It could be either in sed or awk.

For example, if printf statement is

printf("int=%d, str=%s", i, s) ;

Then it should be replaced with :

cout << "int=" << i << "str=" << s;

I tried many way but none of them work as expected.

Thanks.

Aucun commentaire:

Enregistrer un commentaire