Search:

Type: Posts; User: christianB

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    4,778

    ok. I will try and make some improvements. Do you...

    ok. I will try and make some improvements. Do you know of a good reference, be it book or website, for implementing linked lists and binary trees in C? My implementation is pretty much based off of...
  2. Replies
    3
    Views
    4,778

    inserting into a linked list

    I have taken a data structures class which focused primarily on implementing in java but I am trying to apply my knowledge by implementing a few structures in a different language.

    currently I am...
  3. Replies
    44
    Views
    8,658

    #include #include #define...

    #include <stdio.h>
    #include <string.h>
    #define MAX_NAMES 10
    #define MAX_LEN 20

    typedef struct {
    char first[MAX_NAMES];
    char last[MAX_NAMES];
    }Name;
  4. Replies
    44
    Views
    8,658

    yeah, i wish I could. I just sent him an email....

    yeah, i wish I could. I just sent him an email. this is an all online course, and over 6 weeks it's been insane. I've finished all the assignments except this one, but If i don't finish it by today i...
  5. Replies
    44
    Views
    8,658

    he has MAX_LEN and MAX_NAMES defined that way and...

    he has MAX_LEN and MAX_NAMES defined that way and he also defines Name names as having dimension [MAX_NAMES]. it's nothing that i can change.
  6. Replies
    44
    Views
    8,658

    he has them defined like that for some reason....

    he has them defined like that for some reason. Not sure why.
  7. Replies
    44
    Views
    8,658

    fixed. i'm really not sure how I could shorten...

    fixed. i'm really not sure how I could shorten that anymore. I have to check both the first and last names. Now it just prints out the second name I enter for all the elements of my array. I've...
  8. Replies
    44
    Views
    8,658

    ok, so this is what I have. #include...

    ok, so this is what I have.



    #include <stdio.h>
    #include <string.h>
    #define MAX_NAMES 10
    #define MAX_LEN 20

    typedef struct {
  9. Replies
    44
    Views
    8,658

    ok, so I think i'm supposed to keep name.first...

    ok, so I think i'm supposed to keep name.first and name.last to build new array. i will compare all of the names in names[MAX_NAMES]. if all of the names in the array are differnet from name, then...
  10. Replies
    44
    Views
    8,658

    i forgot about those functions. I can't delete...

    i forgot about those functions. I can't delete that printf though, it's part of the code that my professor provided for us. That's partly why I am stuck. I don't understand why I need that scanf,...
  11. Replies
    44
    Views
    8,658

    ok, so first i need to scan in an array of name...

    ok, so first i need to scan in an array of name pairs. So i have this:




    #include <stdio.h>
    #define MAX_NAMES 10
    #define MAX_LEN 20

    typedef struct {
  12. Replies
    44
    Views
    8,658

    not asking anyone to do it for me, i'm just...

    not asking anyone to do it for me, i'm just asking for some direction. I'm just not sure how to start based on the variables I'm given. I'm just hoping for some advice. Thanks.
  13. Replies
    44
    Views
    8,658

    Strings and Structs (remove duplicates)

    Hello, I have one more problem this semester that I need to complete or else i automatically fail my class and it is stumping me. I don't even know how to begin. Here is my code that is already...
  14. Replies
    13
    Views
    1,556

    of course. i'm just being redundant. it works...

    of course. i'm just being redundant. it works now. thanks for all the help. I changed DIM to 4 because I was tired of typing 16 numbers over and over to test it. 16 is supposed to be a %d that reads...
  15. Replies
    13
    Views
    1,556

    so this should work right? #include...

    so this should work right?




    #include <stdio.h>

    #define DIM 4

    int main() {
  16. Replies
    13
    Views
    1,556

    so because I didn't have "ndx < DIM" as a...

    so because I didn't have "ndx < DIM" as a condition in the loop it was going on past the 15th index of both the arrays? It was just my luck that those values happened to be equal huh? I understand...
  17. Replies
    13
    Views
    1,556

    those braces are unnecessary i guess. so you're...

    those braces are unnecessary i guess. so you're saying i'm not asking for "equal/not equal" based on weather or not the indices are equal, but only if my counter gets up to a number I want it to?
    ...
  18. Replies
    13
    Views
    1,556

    Loop that contains arrays

    I have an assignment that requires me to write code that compares two arrays and confirms if every element in the first is equal to every element in the second. this is my code.



    #include...
  19. Replies
    31
    Views
    33,680

    i see. quzah, i wasn't saying that what you...

    i see. quzah, i wasn't saying that what you posted was wrong, rather I was coming up with the wrong code. Thank you so much to everyone for all of your help. I know I probably frustrated the hell out...
  20. Replies
    31
    Views
    33,680

    i'm not sure I understand what Quzah gave me. ...

    i'm not sure I understand what Quzah gave me.



    while input
    if !count && isodd input
    ok = true
    count++
    if isodd input != isodd count
    ignore everything until EOF...
  21. Replies
    31
    Views
    33,680

    this is what I have come up with so far. ...

    this is what I have come up with so far.



    odd = 1; /*one character
    ok = 1; shy of limit*/

    while (EOF != scanf("%d", &val)) {
    if (odd == val % 2 && val != val % 2) ...
  22. Replies
    31
    Views
    33,680

    by flag you mean, if first int is odd, and second...

    by flag you mean, if first int is odd, and second int is even, everything ok.
    would it be possible to do all of that in only two lines?
  23. Replies
    31
    Views
    33,680

    1. scan int 2. check if current int = odd 3....

    1. scan int
    2. check if current int = odd
    3. scan new int
    4. check if new int is even (or opposite old int, or not odd)
  24. Replies
    31
    Views
    33,680

    1. scan for an integer. 2. check if integer is...

    1. scan for an integer.
    2. check if integer is odd or even.
    3. scan second integer.
    4. check if integer is odd or even.
    5. if first int is odd, and second int is even, everything ok.
    if...
  25. Replies
    31
    Views
    33,680

    okay guys, i've been working on it for a while...

    okay guys, i've been working on it for a while and I keep arriving at the same kind of problem. I keep coming up with code that just checks for odd or even numbers, but no particular sequence. I know...
Results 1 to 25 of 36
Page 1 of 2 1 2