Search:

Type: Posts; User: Otto45

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    1,128

    Ah, I get it. I thought that once I started...

    Ah, I get it. I thought that once I started using the array notation in the for loop, it would automatically go to the correct position for test[0], etc.
  2. Replies
    11
    Views
    1,128

    #include #include #include...

    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <assert.h>
    int main(){
    unsigned char **test = calloc(3,sizeof(char*));
    *test = "Test";
    test++;
    *test = "This";
    ...
  3. Replies
    11
    Views
    1,128

    I fixed both of those things in your edit, and it...

    I fixed both of those things in your edit, and it is still doing the same thing
  4. Replies
    11
    Views
    1,128

    I added the headers to my code above, I had them...

    I added the headers to my code above, I had them in mine but I forgot to put them above. Also, I tried your suggestions and I still have the same issue
  5. Replies
    11
    Views
    1,128

    Quick double pointer question

    When I try to assign strings to a double pointer, it only prints out the last string when I try to print everything out, and then it segfaults.


    #include <stdlib.h>
    #include <stdio.h>
    #include...
  6. Replies
    4
    Views
    2,475

    Yes, that makes sense. How would I allocate only...

    Yes, that makes sense. How would I allocate only the first dimension individually, and same question for the second? Would allocating for the first just be:

    keywords =...
  7. Replies
    4
    Views
    2,475

    Reading words into double pointer

    I have a double pointer, and I need to read words into it. Here's what I have so far:

    while(fscanf(keywordFile,"%s",keyinputter)==1){
    keys_cnt++;
    }
    keywords =...
  8. Replies
    5
    Views
    729

    Alright, I was thinking about it wrong then,...

    Alright, I was thinking about it wrong then, thank you.
  9. Replies
    5
    Views
    729

    testSection contains a sentence with spaces in...

    testSection contains a sentence with spaces in between the words. Should this bit of code read in each word individually and the next time sscanf gets called it would move onto the next word?
  10. Replies
    5
    Views
    729

    Infinite Loop Issue

    while(sscanf(testSection,"%s",currentWord)==1){
    if(strcmp(currentWord,argv[1])==0){
    fputc('1',output);
    } else {
    ...
  11. Replies
    4
    Views
    1,082

    Sweet, thank you so much, this is much easier...

    Sweet, thank you so much, this is much easier than I was making it out to be.
  12. Replies
    4
    Views
    1,082

    By four separate goes, do you mean call sscanf...

    By four separate goes, do you mean call sscanf four different times with my different formats? Then only one will work correctly depending on the format of that line correct?
  13. Replies
    4
    Views
    1,082

    Reading In File With fscanf Question

    For a project, I have to read in input from a file, but the tricky part is that each line could have one of four formats:
    "char long char string int float"
    "char long string"
    "char long string...
  14. struct onode* addOrder(struct hashStorage* hash,...

    struct onode* addOrder(struct hashStorage* hash, struct order* data) {
    struct onode *newOrder;
    int position, idNmbr;
    idNmbr = data->id;
    newOrder = newNode(data);
    position =...
  15. Calling Function via function pointer inside a structure pointer

    I'm trying to call a function via a function pointer, and this function pointer is inside a structure. The structure is being referenced via a structure pointer.

    position =...
  16. Replies
    2
    Views
    1,192

    Memory Allocation issues

    I'm trying to allocate memory for an array of pointers to structures with:

    struct onode *onodeArray[size] = (struct onode**)calloc(size,sizeof(struct onode*));
    size is a parameter of the function...
Results 1 to 16 of 16