What compiler are you using there may be an easier solution.
Type: Posts; User: Annihilate
What compiler are you using there may be an easier solution.
Try changing to memmove(&alfa.sir[strlen(alfa.sir)],&alfa.sir[j],1);
Hmm i never really thought about the whole duplicate substrings until after i wrote that functions. I added in the 2D array after. I just can't see where my function is going wrong in terms of...
I am not sure what you mean by that question.
Hi there i am trying to complete a string handling program. That searches a string and finds each 3 character sequences in that string.
ex: Please enter a word up to 10 characters long:...
haha there we go i knew something was up but i forgot that my division originally would leave a decimal result which would require a float type variable. As far as my grading goes I know the max...
Okay that works wonders i threw in the docking marks and 0 marks for blanks.
Now the grading system is throwing me off a little bit. Ive done lots of these before, but for some reason i am...
even with taking out the docking marks the scoring is all kinds of messed up. changed one of the marks to be the exact answer key and it gave me 14 lol.
Haha yeah but if not there then why would that be outside of the loop. Also my last studentId and test are being printed twice at the end for some reason :(.
well i gave my arrays a larger "play room" by setting test and answers to 30 and that got rid of the error messages. I just need to see if the scores are right because they are all negative.
Yeah but going by that would that not mean i would have to do that with all my arrays.
Okay yeah i see what you mean it looks alot prettier too. Now as far as that whole stack thing goes you have any leads i could look into.
# include <stdio.h>
# include <stdlib.h>
# include <time.h>
#include <string.h>
int main()
{
int score;
char answer[21];
char test[21];
haha i wasnt sure if that was how it works so i tried to manipulate it. Now that you have cleared that much up i understand how that works and i will never make that make that misunderstanding again....
I thought if i did that it would still start at the top of the file and include the answer string as a studentId. Ill try that out thanks for the support.
Yes now how would i pull the answer string out of the while()loop without having to process that variable every line. Such that my code would look like.
while(!feof(grading))
{...
Okay there are going to be 21 items in the answer string.
The numbers are from 0 to 20.
My termination is from 0 to <21 which is 20. ???
Im not sure where i went wrong.
So i have my answer string and then it will go to the next line so the next thing will be 'A'? I must be doing this wrong.
well knowing that the string answers is 20 characters long would that not make my file pointer either 20 or because strings have a null \0 at the end of them 21?
As for what i would do next would i...
Regarding the complex conditional i had that originally and then thought it may not have been enough, i am not sure why i changed that. For the fseek i put that in so that hopefully it would have...
well the above code may look a bit weird my idea for the "if(test[i]=='T'&&answer[i]=='T')" was for the loop of i to go through each slot in the arrays and compare the characters that got stored in...
haha sounds good any chance you would be able to tell me where i am going wrong with my code
# include <stdio.h>
# include <stdlib.h>
# include <time.h>
#include <string.h>
int main()
haha yeah i am aware of hows it bad. This is twice that you have sent me this message. My teacher has taught me this way and insists that i program the way they have taught me. So for bad programming...
Here are the changes i made.
while(!feof(grading))
{
fgets(studentId, 9 ,grading);
fscanf(grading, "%s", test);
printf("%s", studentId);
printf("%s", test);
That just worked wonders thank you.
Edit nevermind i was fooled. When i use fscanf on the string test it still wont read the spaces. Upon reaching a space in the scanf it stops at that point and...