Search:

Type: Posts; User: Stormweaver1

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    1,013

    Seg fault?

    oneuh
  2. Replies
    1
    Views
    1,004

    Alright updated my code I think I'm on the right...

    Alright updated my code I think I'm on the right track. I finally figured out what was pointing at what >.<
  3. Replies
    1
    Views
    1,004

    Last C program

    Nevermind...
  4. Replies
    3
    Views
    1,473

    Alright sweet that worked thanks. Now I'll...

    Alright sweet that worked thanks.

    Now I'll start working on the next function.
  5. Replies
    3
    Views
    1,473

    4th C Program

    The awkwardness of having to keep a “previous” pointer while operating on a list using a
    loop can be avoided by maintaining these pointers in the data structure itself.
    struct node {
    int first;...
  6. Replies
    3
    Views
    1,440

    It works now thank you very much :)

    It works now thank you very much :)
  7. Replies
    3
    Views
    1,440

    My third C program

    A regular number is a positive integer all of whose prime factors are in the set {2, 3, 5}. (1
    is assumed to be regular.) Write a function regular that consumes a positive integer n and
    prints out...
  8. Replies
    8
    Views
    2,475

    Yay it worked thank you very much :). It was...

    Yay it worked thank you very much :).

    It was also alot simpler. But that's a good way to learn...to screw up big time lol
  9. Replies
    8
    Views
    2,475

    ooo i should just do 2 while loops. where the...

    ooo i should just do 2 while loops.

    where the first 1 counts up for the x value and the second one counts up for the y value.

    and if they match then print it.
  10. Replies
    8
    Views
    2,475

    hmmm...when i reach the line return sumsqr(n);...

    hmmm...when i reach the line

    return sumsqr(n);

    do all my integers get redefined back to 0?
  11. Replies
    8
    Views
    2,475

    Alright that seemed to work. Until I typed ...

    Alright that seemed to work. Until I typed

    ./sumsqr

    I got a Microsoft Windows error

    "sumsqr.exe has stopped working" I'm going to assume this means I have an infinite loop.
  12. Replies
    8
    Views
    2,475

    Ok I changed what you asked and a few other...

    Ok I changed what you asked and a few other things I noticed.

    sumsqr-driver.c looks like


    #include <stdio.h>

    #include "sumsqr.h"

    int main() {
  13. Replies
    8
    Views
    2,475

    My Second C Program

    Alright Question to is as follows.

    "Write a function sumsqr that consumes a non-negative integer n and prints all pairs (x, y)
    such that x and y are nonnegative integers, x >= y, and x^2 + y^2 =...
  14. Replies
    24
    Views
    3,751

    Alright Question to is as follows. "Write a...

    Alright Question to is as follows.

    "Write a function sumsqr that consumes a non-negative integer n and prints all pairs (x, y)
    such that x and y are nonnegative integers, x >= y, and x^2 + y^2 =...
  15. Replies
    24
    Views
    3,751

    :) So i changed isqrt.h to a "prototype" ...

    :) So i changed isqrt.h to a "prototype"



    int isqrt(int n);


    and it appears to work! Thank you very much for your help. I have learned more from you then I have from a lecture.

    Now onto...
  16. Replies
    24
    Views
    3,751

    alright I googled it and searched for it on these...

    alright I googled it and searched for it on these forums clicked a few links and I still don't understand what you mean by a prototype.
  17. Replies
    24
    Views
    3,751

    no i don't know what a prototype is :(. I just...

    no i don't know what a prototype is :(. I just saved isqrt.c as isqrt.h

    ok i'll google it.
  18. Replies
    24
    Views
    3,751

    so i deleted the isqrt.h but now its complaining...

    so i deleted the isqrt.h but now its complaining that isqrt.h doesn't exist again.

    I'm very confused. I'll keep trying different things though.
  19. Replies
    24
    Views
    3,751

    o...but i have 2 because i thought you needed one...

    o...but i have 2 because i thought you needed one for isqrt.c and one for isqrt.h

    but I guess I'll delete the isqrt.h one.
  20. Replies
    24
    Views
    3,751

    alright all of the errors went away now i have a...

    alright all of the errors went away now i have a new one. So I think I'm close.

    /cygdrive/c/Users/user/AppData/Local/Temp/ccwWTWvi.o:isqrt.c:(.text+0x0):multip
    le definition of '_isqrt'...
  21. Replies
    24
    Views
    3,751

    :O there's no little ";" semi-colon thing. ...

    :O there's no little ";" semi-colon thing.

    I'll give that a try, Thanks a bunch :)
  22. Replies
    24
    Views
    3,751

    so i included the math line #include...

    so i included the math line



    #include <math.h>

    int isqrt(int n) {
    int a = sqrt(n);
    int b = 0
    for (int i = 1; i <= a; i = i+1)
  23. Replies
    24
    Views
    3,751

    1) .....I don't understand. Do you mean I have to...

    1) .....I don't understand. Do you mean I have to compile isqrt.c all on its own as opposed to compiling them at the same time? Or do I have to save isqrt.c as isqrt.h somewhere?

    2) I think I did...
  24. Replies
    24
    Views
    3,751

    well we were given startup code for...

    well we were given startup code for isqrt-driver.c



    #include <stdio.h>
    #include <assert.h>

    #include "isqrt.h"

    int main() {
  25. Replies
    24
    Views
    3,751

    First C program

    So the question is

    Write a function isqrt that consumes a non-negative integer n and produces the largest
    integer less than or equal to the square root of n (that is, the integer square root of...
Results 1 to 25 of 25