Search:

Type: Posts; User: Tiago

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: free n-ary tree

    by Tiago
    Replies
    5
    Views
    6,215

    Done! Quite simple actually... ty void...

    Done! Quite simple actually... ty



    void freeTree(Tree_str *Tree){
    if(Tree){
    freeTree(Tree->brother);
    freeTree(Tree->son);
    free(Tree);
    }
  2. Thread: free n-ary tree

    by Tiago
    Replies
    5
    Views
    6,215

    free n-ary tree

    I'm having a hard time trying to free an N-ary tree, don't know if this is asking too much, but can somebody please post a small and fast algorithm for that? or at least give me some guidelines...
    ...
  3. Replies
    8
    Views
    1,089

    I had already thought of that, just wanted to see...

    I had already thought of that, just wanted to see if there was an alternative... I'll do it that way...

    thank you both...
  4. Replies
    8
    Views
    1,089

    I believe it will spend too much time... is there...

    I believe it will spend too much time... is there any other way to get, for example, the penultimate character of a string faster?
  5. Replies
    8
    Views
    1,089

    The size of a string is static, unless we change...

    The size of a string is static, unless we change it... what I mean by full is with all the spaces or almost all the spaces occupied by non '\0' chars ...
  6. Replies
    8
    Views
    1,089

    how to find out if a string is full?

    Hi,

    Is it possible to find out if a chars string is full or half full?

    I want to use realloc after a malloc, but only if the chars string is almost full...

    TY
  7. Ok, thank you... problem solved... void...

    Ok, thank you... problem solved...



    void OpenFiles(char *arg){

    char *fpInName, *fpOutName;

    fpInName = arg;
  8. Conditional jump or move depends on uninitialised value(s)

    Hello...

    I don't know why, but valgrind keeps giving me this error:



    ==2187== Conditional jump or move depends on uninitialised value(s)
    ==2187== at 0x40A550B: vfprintf...
  9. Problem solved, never mind...

    Problem solved, never mind...
  10. warning: ‘XXX’ is used uninitialized in this function

    Hello everybody,

    I've this structure:



    typedef struct _Files_str {
    char *fpInName, *fpOutName;
    FILE *fpIn,*fpOut;
    } Files_str;
  11. Thread: bitfields

    by Tiago
    Replies
    2
    Views
    1,907

    bitfields

    Hi everybody...

    The following code says that the bit field has a size of 4 bytes:




    typedef struct BitField{
    unsigned int A:1;
    } BitField;
  12. Replies
    4
    Views
    1,073

    LOL, believe me, I'm not... Don't say that kind...

    LOL, believe me, I'm not... Don't say that kind of things to me, some of the C gurus may feel insulted xD
  13. Replies
    4
    Views
    1,073

    I don't know what you have already learned or how...

    I don't know what you have already learned or how much you want to learn about C, what I can say, from self experience, is that the way lo learn C is all about programming and programming again, and...
  14. Replies
    8
    Views
    10,033

    Ok, thank you all... I've never been taught...

    Ok, thank you all...

    I've never been taught how to use bit operations and logic in C, but despite that (I'm going to have to learn it sooner or later), I'm going to spend some time trying to use...
  15. Replies
    8
    Views
    10,033

    actually I'm not :) unsigned int type:4; ...

    actually I'm not :)


    unsigned int type:4;



    I'm not seeing how I'm going to change a single bit from the bit-word without adding too many logic to the program (I hate logic, even more if...
  16. Replies
    8
    Views
    10,033

    Changing a single bit of an integer

    I've created a 4 bits Int... I want to change only one of the 4 bits of this Int, how do I do that?

    ty...
  17. Replies
    1
    Views
    2,393

    Open a file, read it ... and ... read it again

    After reading a file how do we manage to put the file pointer back to the beginning of the file?


    ty...
  18. Thread: Board Game

    by Tiago
    Replies
    4
    Views
    2,404

    The goal is to have a really fast program, memory...

    The goal is to have a really fast program, memory is also a problem since this matrix (the game board) can have any size, the program will also use tons of memory and time trying to find a solution....
  19. Thread: Board Game

    by Tiago
    Replies
    4
    Views
    2,404

    Board Game

    Hi, I'm supposed to make a program to solve a Board Game similar to a Chess Board. I want to store the information about pieces and their possible moves, during the game, in an integer matrix so each...
  20. Replies
    2
    Views
    9,208

    fprintf vs printf

    Hi...

    Is there any difference between fprintf(stdout, "........") and printf("........")?

    Which one is better?

    They seem to do the same thing... I'm looking for a reason to use one and not...
  21. Thread: g2_poly_line

    by Tiago
    Replies
    1
    Views
    1,077

    g2_poly_line

    can anybody help me with this function from g2 library?

    further information at this link:
    http://www.ib.cnea.gov.ar/~oop/g2/group__graphic.html#gdafb426bd26b996c0ef4bb6cb74e3b7f

    i want to use...
  22. Thread: printf...

    by Tiago
    Replies
    2
    Views
    1,189

    printf...

    How do I get rid of the rounding of "printf"?
    I'm using float (% f) to read numbers from a file, and when I "printf" them they get rounded. They have only five decimal places.

    TY
    regards ;D
  23. Replies
    11
    Views
    25,901

    thanks for the replies... Yes, you were...

    thanks for the replies...


    Yes, you were right...

    ... afterall they all do the same... i'm going to use sprintf... seems fancier xD
    I was wondering if there was a very good reason to use one...
  24. Replies
    11
    Views
    25,901

    strcpy vs sprintf

    Hi guys... and girls, if any... xD

    Can someone tell me the main difference between strcpy and sprintf?

    They are going to be used here:



    typedef struct type_node{
    char string[1024];
  25. Replies
    3
    Views
    2,625

    Detect Ctrl+anykey (e.g. Ctrl+A)

    Hi,

    How can i detect when Ctrl+anykey is pressed simultaneously???

    My program should exit when I write "exit" or when Ctrl+D is pressed... I know that normally Ctrl+D should kill a program...
Results 1 to 25 of 28
Page 1 of 2 1 2