Search:

Type: Posts; User: kuljule

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. nevermind figured it out. Thanks!

    nevermind figured it out. Thanks!
  2. I'm sorry if I am seeming like I'm not listening....

    I'm sorry if I am seeming like I'm not listening. I am, but I am just really confused. Can you repeat where the seg fault is coming from? The program prints out the sentence but then after...
  3. Its C Programming. That's the class. The thing...

    Its C Programming. That's the class. The thing about initializing it means that it won't work if its greater than that number. I want to be able to do this with any length of a string. I think...
  4. using gets(sent) doesn't change the segmentation...

    using gets(sent) doesn't change the segmentation error. But how do I initialize i?
  5. What do you mean i is not initialized? Isn't it...

    What do you mean i is not initialized? Isn't it initialized in the for loop?
    Also, I here bad talk about using fgets. Why do people go against using it? What's the difference between fgets and...
  6. word count program - Please HELP!!! Segmentation error!!!

    I keep getting a segmentation error and i don't know why. Can you please help?

    Thank you!

    Here's the program:


    insert
    /*This program is suppose to take a sentence as input (in a string)...
  7. Replies
    36
    Views
    4,810

    Thanks!

    Thanks!
  8. Replies
    36
    Views
    4,810

    how do you do that?

    how do you do that?
  9. Replies
    36
    Views
    4,810

    I mean why for certain values of j do you get...

    I mean why for certain values of j do you get z[j] being some huge number?
  10. Replies
    36
    Views
    4,810

    also when you do that. z[4] should be 25 or some...

    also when you do that. z[4] should be 25 or some integer. Why doesn't it give that?
  11. Replies
    36
    Views
    4,810

    I'm confused. What data is incomplete? And...

    I'm confused. What data is incomplete? And taking it out of the loop doesn't do anything. Do i have to take it out of both of the loops? Or out of the while loop completely?
  12. Replies
    36
    Views
    4,810

    what did you take out of the loop?

    what did you take out of the loop?
  13. Replies
    36
    Views
    4,810

    I don't get that. I get it doing the same thing...

    I don't get that. I get it doing the same thing over and over again in a loop having z[0] = 1 and then z[0] = 2 and so forth until z[0] = 10. Which i really don't get.
  14. Replies
    36
    Views
    4,810

    No cause its x[k] and y[j-k] so when j is 15,...

    No cause its x[k] and y[j-k] so when j is 15, then k is j-9 which gives 6 so its x[6]*y[9] = z[15]
  15. Replies
    36
    Views
    4,810

    why do they have to be the same size? I'm just...

    why do they have to be the same size? I'm just giving you what the assignment states. It states that x is size 10, y is size 10, and z is size 19.
  16. Replies
    36
    Views
    4,810

    Yeah i have to compute the z array for z[1],...

    Yeah i have to compute the z array for z[1], z[2], z[3], and so on until z[18].

    And I can set them to zero after I get the program to do what I want it to do.
  17. Replies
    36
    Views
    4,810

    ok so now it executes but it gives a lot of...

    ok so now it executes but it gives a lot of numbers all randomly which i don't really understand why. I'm trying to write code to do the summation of x[k] * y[j-k] from k=max(j-9,0) to min(9,j) and...
  18. Replies
    36
    Views
    4,810

    nevermind. Thanks.

    nevermind. Thanks.
  19. Replies
    36
    Views
    4,810

    Yes that's true. I forgot about the semicolon. ...

    Yes that's true. I forgot about the semicolon. I had it right when using the terminal to compile it so it did compile. But the code you just wrote still says segmentation error.
  20. Replies
    36
    Views
    4,810

    Yeah I found that error but after I changed it, I...

    Yeah I found that error but after I changed it, I still get a segmentation error. Any ideas?
  21. Replies
    36
    Views
    4,810

    My teacher told me to do it like that. And I...

    My teacher told me to do it like that. And I also did it with the two fscanf statements again and i got a segmentation fault. Its like anyway I do it I get a segmentation fault.

    ----Julian
  22. Replies
    36
    Views
    4,810

    I'm confused. Here is my whole program. Maybe...

    I'm confused.

    Here is my whole program. Maybe you can see why i keep getting a segmentation error.

    insert

    #include <stdio.h>

    int min_number (int x, int y)
    {
  23. Replies
    36
    Views
    4,810

    actually i have one more question. How do I...

    actually i have one more question. How do I program it to keep scanning until the end of the file. I know I use EOF but when i put in

    while(input_status != EOF && input_status2 != EOF)

    it...
  24. Replies
    36
    Views
    4,810

    thanks! Yeah I should have known that. Now it...

    thanks! Yeah I should have known that. Now it works great! Thank you so much!

    ---Julian
  25. Replies
    36
    Views
    4,810

    ok so I did it like this: input_status =...

    ok so I did it like this:

    input_status = fscanf(inp, "&#37;d", &i);
    input_status2 = fscanf(inp, "%f %f", &x[i], &y[i]);

    and now I don't get a segmentation error but it prints out

    0 0.007813...
Results 1 to 25 of 27
Page 1 of 2 1 2