I have an array of strings that I would like to print. I know to print them you use %s and for instance %.6s to specify printing 6 elements of string. Is there any way so that I can specify a non-fixed integer value of times to print? (For instance have it print i times in the below example). Below is my loop as is currently done.
for (i=0;i<num_locations;i++){
printf("%.6s",&locations[i][0]);
}