Hi again!
I am taking a file and tokenizing the comma separated variables into strings and suppose to take each variable and put it into a 5 variable per line string.
Any help would be...
Type: Posts; User: patso
Hi again!
I am taking a file and tokenizing the comma separated variables into strings and suppose to take each variable and put it into a 5 variable per line string.
Any help would be...
I see where I went wrong.
@smokeyangel
Thank you for showing me this. I appreciate this more than you will know. I believe I understand now how you went about this.
I followed that with...
STEPS:
1. Declare an input string as follows:
char InputString[] = "the dog thought up a lie done";
Note that "done" is the last word that appears in the sentence, but not part of the sentence...
what does
system("PAUSE");
mean?
use it in conjunction with % (mod) to randomly generate as many numbers up to the desired number.
it is for an intro to algorithms course. It is first year second semester
i believe so
this is the part I don't understand. do you count the numbers as words to count back?
ok, I am sorry, how would I get the index. Feengur and itCbitC, how are you figuring this out?
I don't understand what is being asked.
I don't want the code, I just want to know how to go about it and where to look for examples of this.
A simple scheme for creating a compressed version...
yes that would good to see. The more info I learn the better.
How would I put *b[] into equal lengths? Would there be a set way of doing it?
input in red
Displaying contents of *b[]dd
aa
cc
e
f
b
press enter to continue
works great for single inputted letters, as soon as there is more it gets screwed up
this is the output
print a line:asdf
This is a loop
This is the second buffer
asdf
The line to print:
asdf
The new line is:
fdsa
i don't know what you mean. I thought i was using bubble sort
as soon as I go over three words, it won't alphabetize them....
printf("Please enter the string to be parsed:\n");
gets(buffer5);
printf("\n");
char *b[20];
It works for the desired number 4. But if I go under that or over it gives me a segmentation fault. How could I get strlen in there when it is being tokenized to determine the amount of tokenized...
i have been told that I could use a bubble sort in conjunction with strcmp to get it to sort alphabetically.
I don't know how to go about putting the strcmp into a bubble sort.
i was just trying that to see if it would work.
got it to work somewhat. It will post both just won't put in order and post repeats instead of the actual characters. won't post last character either....?
Thought blue might be needed for base...
Here is my full code. The red area is where the tokenized strings should be checked for comparability by the first character. Giving me same problem.
THe last thing i need and am trying to figure...
awesome, I took out the
else puts ("NULL token");
Thank you so much.
Okay, I now know what the problem is
/*Part 4*/
printf("Please enter the string to be parsed:\n");
gets(buffer5);
printf("\n");
char *b[20];
k well, I am trying very hard to understand this. Here is another way I tried doing it.
char *b[20];
b[0] = strtok(buffer5, " ,;.");
for(i = 1; i < 20; i++){
b[i] =...
could I essentially do this:?
printf("Please enter the string to be parsed:\n");
gets(buffer5);
printf("\n");
tokenptr = strtok(buffer5, " ,;."); /*Begins...