Search:

Type: Posts; User: wuzzo87

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    8,325

    Thanks guys for the help... I got my program...

    Thanks guys for the help...

    I got my program fixed already... :D
  2. Replies
    9
    Views
    8,325

    Mod with negatives

    Hi,

    Why does C return to me -9 when i calculate, -9 % 26 ?
    Python gives me what i wanted -9 % 26 = 17. .....

    I'm wondering if C has an implementation of mod like Python, or how to go about...
  3. Replies
    8
    Views
    1,772

    Hey thanks a lot for the help!!!! certainly is...

    Hey thanks a lot for the help!!!!
    certainly is useful

    I got it to work already :)
  4. Replies
    8
    Views
    1,772

    yea, i did that, but, somehow it still doesn't...

    yea, i did that, but, somehow it still doesn't give the right output....


    printf("n: %d -- %d\n", n, *number);


    is it due to me using 'vi' and typing numbers in a file rather than using...
  5. Replies
    8
    Views
    1,772

    int main(int argc, char **argv) { FILE...

    int main(int argc, char **argv)
    {
    FILE *fp;
    int *number = malloc(sizeof(int));
    int n;

    fp = fopen(argv[1], "r");

    while((n = fread(number, sizeof(int...
  6. Replies
    8
    Views
    1,772

    a lil' help using fread()

    Can someone please help me with the usage of fread?

    like errm, explain why my small test code don't quite work.

    It's just reading a series of numbers(int) from a file.



    int main(int argc,...
  7. Replies
    3
    Views
    2,203

    sorry guys.. i've fixed the problem.. it was a...

    sorry guys..
    i've fixed the problem..
    it was a silly mistake of mine :(

    Sorry for disturbing..
    THX!
  8. Replies
    3
    Views
    2,203

    like ermm... is there anything particularly...

    like ermm...
    is there anything particularly wrong with my hashtable_insert() function and my lookup function?
  9. Replies
    3
    Views
    2,203

    Missing Entries in Hashtable

    Ok guys..
    i'm so sorry this is a big chunka code....
    But this is my problem, there seem to be some missing entries when i insert these stuff into my hashtable...

    The input file is as...
  10. Thread: Hash Help

    by wuzzo87
    Replies
    29
    Views
    3,114

    Seg fault at hash func fixed

    Oh yep!...u're right, shouldn't be returning single character from chomp().... thanks
    i'ved fixed that, and now segfault, happens in the hashtable_insert() function at the strcpy part....

    but...
  11. Thread: Hash Help

    by wuzzo87
    Replies
    29
    Views
    3,114

    Hash Help

    Hi,
    I seem to get a seg fault when i implement this hash function from 'Algorithms in C -Sedgewick' ....
    I'm think it's more of my structuring, and pointer problems..



    typedef struct {
    ...
  12. Replies
    3
    Views
    2,105

    sorry guys, my fault.... i'm cleaning up the...

    sorry guys,
    my fault....
    i'm cleaning up the whole code...

    There seem to be something wrong with my insertion to the table..
    but i'll try to fix that up by myself 1st..
  13. Replies
    3
    Views
    2,105

    Floating point exception ????

    Hey guys..

    I'm implementing a simple hash function to test my hash table ... but when i compute value for the hash value, i get this error of which i've never encountered, if i remember


    ...
  14. haha... ..thank you... I got it! i did ...

    haha... ..thank you... I got it!
    i did


    (*a)->next;


    I'll test if the matrix formation's right... :)
  15. Ok thanks Happy_Reaper i've fixed the -> and...

    Ok thanks Happy_Reaper
    i've fixed the -> and thing..but..
    i still am not sure how to get rid of this error.... really..



    topsort.c:185: error: request for member `next' in something not a...
  16. allocate_2d_array()

    ops, i'm sorry....here's the function given,



    /*
    ** Dynamically allocate a 2d array of ints of size rows * cols
    ** and the set the value of all elements to initial_value.
    */
    static int **...
  17. btw, i get this compilation errors... not quite...

    btw, i get this compilation errors... not quite sure how to access element within a **node structure type... like 'adjacencies'


    topsort.c: In function `convert_to_adj_matrix':
    topsort.c:171:...
  18. A little help with conversion of adj.list to adj.matrix

    Hey guys,
    I've just learn graph basics and this is the first graph like code i'm facing(topological sort) ....
    I need to convert a given adjacency list of the graph to an adjacency matrix...
  19. Thread: time.h

    by wuzzo87
    Replies
    28
    Views
    3,884

    woops...forgot to add the free() ...again... ...

    woops...forgot to add the free() ...again...
    Anyway, i've added the <stdbool.h> header to implement bools in C.... :)
  20. Thread: time.h

    by wuzzo87
    Replies
    28
    Views
    3,884

    Here's it: int main(int argc, char **argv)...

    Here's it:


    int main(int argc, char **argv)
    {
    int array[100];
    int item,j, i=0;
    int *comp = malloc(sizeof(int));
    int comp_result;
    clock_t start, stop;
  21. Thread: time.h

    by wuzzo87
    Replies
    28
    Views
    3,884

    But the funny thing is, I did a timing for a...

    But the funny thing is,
    I did a timing for a mergesort program, and it always results in 0 time interval..
    I used a 'double' and %g for printing.

    Could it be that the sorting happens too fast?...
  22. Replies
    31
    Views
    29,597

    Gosh! how silly of me!.... thank you!! I have...

    Gosh! how silly of me!.... thank you!!
    I have to really read up on '*' and '&' operators for pointers...

    My utmost gratitude expressed : Thank you everyone!!
  23. Thread: time.h

    by wuzzo87
    Replies
    28
    Views
    3,884

    KONI, you might just be right! .... I decided...

    KONI, you might just be right! ....
    I decided to add this, before the getchar();

    like,


    while(x<1000000)
    x++;

    and finally it wasn't 0...but was like 0.09..
  24. Replies
    31
    Views
    29,597

    Someone help me with pointers plz... it's the...

    Someone help me with pointers plz...
    it's the last bit of my prog and it's all done. waahhaahaa...
  25. Thread: time.h

    by wuzzo87
    Replies
    28
    Views
    3,884

    I'm using Linux Mandrake 10.1 and ran the FAQ...

    I'm using Linux Mandrake 10.1 and ran the FAQ program.
    The result too was 0.0000.
    And my CLOCKS_PER_SECOND is 1000000...

    At first start & end is always 0.
    After running it for about...
Results 1 to 25 of 52
Page 1 of 3 1 2 3