Search:

Type: Posts; User: mgimbl

Search: Search took 0.01 seconds.

  1. I didnt declare the typedef char * String ......

    I didnt declare the typedef char * String ... that was a given, but why would you say thats a dangerous typedef (sorry .. new to c, I used java before so I am not very familiar with this language yet...
  2. I think I found it .. it was in another part of...

    I think I found it .. it was in another part of the program .. It was the first error that was getting me, sorry about that. Sometimes just taking a little break and coming back can make a world of...
  3. found one of my problems and edited it as...

    found one of my problems and edited it as necessary, but it still doesnt open the file for reading .. it says it does, but it really doesnt. Let me play around with it a little bit more and see if I...
  4. sure ... FILE * openFile(String filename)...

    sure ...



    FILE * openFile(String filename) {
    fprintf(stderr, "Opening %s ... ", filename);

    FILE * ptr = fopen(filename, "r");
    if(ptr == NULL){
    fprintf(stderr, "failed!\n");
  5. Hey Thantos .. I was wondering if you could help...

    Hey Thantos .. I was wondering if you could help me with another problem. I searched the board but couldnt find an answer.

    I have this declared:


    typedef char * String;


    I want to get the...
  6. oh yeah .. this is gonna get real fun :) ...

    oh yeah .. this is gonna get real fun :)

    Thanks for the quick reply ...

    BTW .. is there another way of writing Bob **low = array;?
  7. assuming this is from the function that Thantos...

    assuming this is from the function that Thantos provided, are these two statements the same?

    Bob **low = array;
    Bob *low = *array;

    I dont think they are ...
  8. OMG! It just clicked ... like you said, I had...

    OMG!

    It just clicked ... like you said, I had even said it myself ... kennel is just a pointer to an array of Dogs. I want to create a pointer that points to a pointer. We havnt gotten to that...
  9. okay .. I need to get some stuff straight first...

    okay .. I need to get some stuff straight first ... so we'll start at step one



    int findDog(DogType * const kennel[], int numDogs, const String target) {
    DogType * leftPtr = kennel; // does...
  10. okay .. first off, I am sorry for making this a...

    okay .. first off, I am sorry for making this a super long drawn out process :\

    Your code worked great .. but when I translated your code into mine, I got a segmentation fault (again when trying...
  11. I had changed my code .. here is a copy of my...

    I had changed my code .. here is a copy of my updated code:



    int findDog(DogType * const kennel[], int numDogs, const String target) {
    DogType * leftPtr = (DogType*)malloc(sizeof(DogType));...
  12. you guys are awesome .. thanks for all the help...

    you guys are awesome .. thanks for all the help so far .. but there is still one little kink in this algorithm. After all my 'I just woke up' editing and quick fixes (like mallocing memory .....
  13. oh I am sorry ... I didnt update that piece of...

    oh I am sorry ... I didnt update that piece of code ... these are my error now:

    kennel.c: In function `findDog':
    kennel.c:55: error: invalid operands to binary -
    kennel.c:55: error: invalid...
  14. sorry for being a major pain :) same errors...

    sorry for being a major pain :)

    same errors are still present after your last suggestion ...
    I have linked my actual code.



    int findDog(DogType * const kennel[], int numDogs, const String...
  15. here are my errors when trying to compile that...

    here are my errors when trying to compile that code above:



    [mgimbl@localhost project1]$ make
    gcc -c kennel.c
    kennel.c: In function `findDog':
    kennel.c:55: error: invalid operands to binary...
  16. well that solved one of my big questions .. and I...

    well that solved one of my big questions .. and I now know what I have to return, thanks.

    But the other problem is I have StructType pointers and I need int pointers (I think) ..
    See my return...
  17. Binary search of an array of pointers to structs using pointer arithmetic

    I have an array of structs and I want to B-Search these by a value inside of them. I am having trouble because I need to return the index (not address) after searching through the array of structs...
Results 1 to 17 of 17