Apr 10, 2002 #1 Bushbaby Programmer Apr 10, 2002 1 US Suppose I write a couple paragraphs and save it as apple.txt. How do I put this file into an array and remove the blank spaces.
Suppose I write a couple paragraphs and save it as apple.txt. How do I put this file into an array and remove the blank spaces.
Apr 10, 2002 #2 RbgoWeb Programmer Apr 10, 2002 91 NL Well, I give it a shot. But you have to test it yourself ok? int main() { //assume all your text is in there at this stage char szParagraphs[65535]; //? //this is the target buffer char szFileText[65535]; int i=0, j=0, strl=strlen(szParagraphs); while(i < strl){ if(szParagraphs!= ' ') szFileText[j++] = szParagraphs; i++; } return 0; } Upvote 0 Downvote
Well, I give it a shot. But you have to test it yourself ok? int main() { //assume all your text is in there at this stage char szParagraphs[65535]; //? //this is the target buffer char szFileText[65535]; int i=0, j=0, strl=strlen(szParagraphs); while(i < strl){ if(szParagraphs!= ' ') szFileText[j++] = szParagraphs; i++; } return 0; }