Printf doesnt have the capacity of its own to repeat certain strings. The simplest way to repeat a string , say, 2 times is to do this...
Code:
for(x=1;x<3;x++) { printf("WHATEVER"); }
another way is to define a wrapper function. This would be the easiest way if you were going need a "repeating printf" often. This code defines the wrapper function printfr, which repeats a string a certain number of times.
Code:
#include <stdio.h>
void printfr(char* string,int xs);
main(){
char *str="hey\n";
printfr(str,4);
}
void printfr(char* string,int xs){
int x;
for(x=0;x<xs;x++){
printf("%s",string);
}
}
A better printfr wrapper could be made with using using argument lists, but I have no idea how C proficient you are.