Search:

Type: Posts; User: SIKCAR

Search: Search took 0.02 seconds.

  1. Replies
    1
    Views
    1,161

    removing from array

    I'm just wondering if anyone know an efficient algorithm to remove an object from an array and move everything up.
    ie removing 2 from 1, 2, 3, 4, 5
    will be 1, 3, 4, 5

    Do I need to use pointers?
  2. Replies
    7
    Views
    4,962

    sorry, I missed a ) when I typed it here, but...

    sorry, I missed a ) when I typed it here, but that wasn't the problem

    basically I get
    parse error before 'const'

    in an example I've got, they were comparing char
    but they could do

    ...
  3. Replies
    10
    Views
    1,266

    what do you mean by non inline function?

    what do you mean by non inline function?
  4. Replies
    7
    Views
    4,962

    thanks now when I want to use the function in my...

    thanks
    now when I want to use the function in my main function
    I get parse error

    I tried to do mysort(keyArray, 50, 30, compare(const void *,const void *);

    and mysort is


    void mysort(int...
  5. Thread: C header files?

    by SIKCAR
    Replies
    16
    Views
    2,302

    so in this case, inside maindriver.c in the main...

    so in this case, inside maindriver.c
    in the main function
    can I still use the functions from function.c? when I have only included function.h?
    eg

    #include<stdio.h>
    #include "function.h"

    int...
  6. Replies
    6
    Views
    1,790

    Oh just thought you would also want to know how...

    Oh just thought you would also want to know how to print out the backslash (\) character too
    you just do \\
    and \' to print out '
    \" to print out "
    \? to print out ?
  7. Replies
    7
    Views
    4,962

    int compare( const void *op1, const void *op2 ) ...

    int compare( const void *op1, const void *op2 )
    {
    const char **p1 = (const char **) op1;
    const char **p2 = (const char **) op2;
    return( strcmp( *p1, *p2 ) );
    }


    When I tried...
  8. Replies
    7
    Views
    4,962

    problem with incompatible pointer type

    When compiling one of my function, it gives me a warning message
    "passing arg 4 of 'qsort' from incompatible pointer type"
    what does this mean?

    here's some of the codes that's related


    int...
  9. Replies
    10
    Views
    7,570

    alright thanks :)

    alright thanks :)
  10. Replies
    10
    Views
    7,570

    Bug

    And just a bug in the program, with the very same code.
    I somehow take in the last element of my input file in twice, and printing them out twice in my for loop.
    ie it prints
    456 aaa
    124 abc
    124...
  11. Replies
    10
    Views
    7,570

    Oh, I forgot to include string.h thanks for that...

    Oh, I forgot to include string.h
    thanks for that ;)
  12. Replies
    4
    Views
    3,156

    I'll keep trying to use fputs and fprintf to...

    I'll keep trying to use fputs and fprintf to store the data.
    I guess I could also try opening the dictionaryfile up, coz I'm meant to pick random words out of the dictionaryfile which has over 20000...
  13. Replies
    10
    Views
    7,570

    also, I'm not too familiar at using strdup can...

    also, I'm not too familiar at using strdup
    can you please explain how to free the memory malloc()'d by this function?

    Thanks,
    Will
  14. Replies
    10
    Views
    7,570

    Thanks for that, I have also checked for the...

    Thanks for that, I have also checked for the return values.

    But now I have error compiling the line
    array[i].name = strdup (name);

    "warning: assignment makes pointer from integer without a...
  15. Replies
    4
    Views
    3,156

    writing stdout to a file

    I think the subject of this thread is probably wrong. But basically I've written a program to print out exactly what I wanted to stdout, but having trouble writing to a file.

    The codes I have...
  16. Replies
    10
    Views
    7,570

    Storing words from a file to an array

    Hi I'm trying to store some words from an input file to an array, but I keep getting segmentation faults.
    The input text file looks something like this
    135 hello
    124 help
    1 first
    each word...
Results 1 to 16 of 16