Search:

Type: Posts; User: kr0n1x

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    18,531

    Ok :) Anyway, I was curious and I checked...

    Ok :)

    Anyway, I was curious and I checked about that macro with this source code:


    #include <stdio.h>

    int main(void){
    #ifdef _BSD_SOURCE
    printf("_BSD_SOURCE is defined\n");
  2. Replies
    4
    Views
    18,531

    Thanks for your support, grumpy. I was reading...

    Thanks for your support, grumpy.

    I was reading 'man signal' to learn more about this behaviour, and it seems to change according to libc version and macros defined.



    In my Ubuntu 10.04...
  3. Replies
    4
    Views
    18,531

    When to re-enable signal handlers

    I'm reading the GNU libc manual, the part about signals.

    In this page it shows some code. I report it here:


    #include <signal.h>
    #include <stdio.h>
    #include <stdlib.h>
    ...
  4. Replies
    5
    Views
    13,500

    A lot of the recursive functions I've been using...

    A lot of the recursive functions I've been using have returns (for example those with trees and lists management). Since I was not able to make it with returns (in this exercise), I was curious to...
  5. Replies
    5
    Views
    13,500

    Merge two sorted arrays recursively

    Hi, the exercise is this:
    I got two sorted arrays (of any length) and I got to merge them into a new array (of correct length, and still sorted), recursively.

    I solved the problem like this:

    ...
  6. Replies
    9
    Views
    2,310

    I found a way to implement it with a queue. I...

    I found a way to implement it with a queue.

    I should make the code better (at least the level_insert() function), but I'll post it anyway just for someone who could need it.

    Tree level insert...
  7. Replies
    9
    Views
    2,310

    @iMalc: That's how I wanted the tree to look...

    @iMalc: That's how I wanted the tree to look like, sorry if i wasn't clear in the first post.

    That algorithm is awesome :D

    Is the queue implementation possible/useful/easier? Which would you...
  8. Replies
    9
    Views
    2,310

    I don't care to keep the tree balanced, I only...

    I don't care to keep the tree balanced, I only need to fill a tree by using a struct like this:

    struct node {
    int data;
    struct node *left;
    struct node *right;
    };

    I've seen some...
  9. Replies
    9
    Views
    2,310

    Create a balanced (not BST) tree

    Hi, I would like to learn an algorithm to create a balanced tree.
    I don't mean a Binary Search Tree (lowerThanRoot values go to left, HigherThanRoot go to right), I just want the tree to fill...
  10. Replies
    6
    Views
    1,657

    Oh... at the university my professors taught me...

    Oh... at the university my professors taught me wrong.
    I didn't know that it contained malloc too... I'm reading on wikipedia right now.
  11. Replies
    6
    Views
    1,657

    Yay I got it :D #include malloc.h then,...

    Yay I got it :D

    #include malloc.h

    then, right before the strncpy instruction, I put:
    result = malloc(i2);

    Now it seems to work :) thanks! I will complete it for multiple files.
    ...
  12. Replies
    6
    Views
    1,657

    Ehm... what's wrong with that "result =...

    Ehm... what's wrong with that "result = strncpy(result, *ppc, i2);" ? In that part i want it to point to the "first part" of the filename, the part which is before the (copy) string (which I add it...
  13. Replies
    6
    Views
    1,657

    Managing strings, renaming problems

    Hi, I'd like to make a program which does this renaming work:

    example.txt -> example(copy).txt

    Also, I'd like it to support any number of '.' into the file name, like:

    example.2011.txt ->...
Results 1 to 13 of 13