that didnt work as good as i hoped it would
this found the newline and replaced it with null
for(j=0; j<30; j++)
{
if(titles[i][j]=='\n')
{
Type: Posts; User: theoneandonly
that didnt work as good as i hoped it would
this found the newline and replaced it with null
for(j=0; j<30; j++)
{
if(titles[i][j]=='\n')
{
i used strlen() to find the end of the string and i knew the new line char was the second from last beacuse the null is last and i replaced it with null
well i fixed my problem
i used %.29s flag with printf to limit the number of chars printed and i removed that whole for loop and used
while (playtime[i]!=0)/* if playtime ==0 then there is no...
i couldnt get that to work, so i went back to %.29s and it works, but i am having trouble testing my array for the \n
i am trying to test the elements in the array and see if there is a \ ...
sorry
thanks for the help
ill look for it
its a while loop :o
void printOneCol(int select[MAXS], int playtime[MAXS], char titles[MAXS][MAXL] )
{
int i = 0;
int mins, secs;
while (playtime[i]!=0)/* if playtime ==0 then there is no song there*/
{...
i read the strings in off a file and so the new line character is included in the array and gets printed with the other characters, but when i dont print all the characters the new line is not...
it works so thank you, but in the for loop i have when it stops printing after the 28th letter it doesnt put a new line, but when it doesnt reach 28 it adds a new line i dont know why this is.
i only want to print the first 28 characters of my array holding a total of 54 characters using printf.
is there a printf flag that only prints as many chars from my array that i tell it to?