Search:

Type: Posts; User: mnml

Search: Search took 0.00 seconds.

  1. Replies
    6
    Views
    1,384

    As for the rest, it is implemented in C++

    As for the rest, it is implemented in C++
  2. Thread: scanf

    by mnml
    Replies
    9
    Views
    4,116

    Thanks a lot for all your replies by the way.

    Thanks a lot for all your replies by the way.
  3. Thread: scanf

    by mnml
    Replies
    9
    Views
    4,116

    I think I figured it out. All I had to do was...

    I think I figured it out. All I had to do was increase the array's size by one.
    I'm entering 3 chars to prev_move uppercase lowercase and a number, for example Pa2 and a2 to next_move.
  4. Thread: scanf

    by mnml
    Replies
    9
    Views
    4,116

    I can't believe I'm struggling with this 2 hours...

    I can't believe I'm struggling with this 2 hours now. I've tried several methods with no luck.
    Do you mean I should not have a whitespace between " and % inside scanf ?
  5. Thread: scanf

    by mnml
    Replies
    9
    Views
    4,116

    Is there any way to clear the buffer before the...

    Is there any way to clear the buffer before the second scanf ?
    I don't want to change the arrays size because I use them somewhere else in my program
  6. Replies
    6
    Views
    1,384

    Here's a good doubly linked list implementation:...

    Here's a good doubly linked list implementation: http://www.snippets.24bytes.com/2010/06/double-linked-list.html

    tin askisi 2 kaneis? :)
  7. Thread: scanf

    by mnml
    Replies
    9
    Views
    4,116

    scanf

    I can't for the love of god understand why scanf doesnt work.
    here's the code:



    void main ()
    {
    char prev_move[3], next_move[2], new_move;

    printf("Press 'y' for a new move or...
  8. Replies
    8
    Views
    16,255

    Thanks for your reply and explanation. Do you...

    Thanks for your reply and explanation.
    Do you mean that I should return a pointer to pointer inside allocate_memory() function?
    How do I implement that?

    all my code:



    #include <stdio.h>...
  9. Replies
    8
    Views
    16,255

    Duh, right. I was allocating the memory in a...

    Duh, right. I was allocating the memory in a function like that.



    void allocate_memory(char **game)
    {
    //char **game;
    game = (char**)malloc(8 * sizeof(char*));
    int i;
    for(i...
  10. Replies
    8
    Views
    16,255

    Can you explain this a bit more? check the return...

    Can you explain this a bit more? check the return value of malloc?
    Thats my code, at least thats where I'm stuck with my exercise.

    this:


    game[0][0] = 'r';
    game[0][1] = 'b';
    game[0][2]...
  11. Replies
    8
    Views
    16,255

    Dynamic char array allocation and assignment

    I'm allocating memory for a 8X8 char array:



    char **game;
    game = (char**)malloc(8 * sizeof(char*));
    for(i = 0; i < 8; i++)
    game[i] = (char*)malloc(8 * sizeof(char));

    then try to...
  12. Replies
    6
    Views
    27,213

    Thanks

    Thanks
  13. Replies
    6
    Views
    27,213

    this is my complete do while condition ...

    this is my complete do while condition





    char menu;

    do {
    printf("MAIN MENU\n");
  14. Replies
    6
    Views
    27,213

    With scanf() I need to press a character, Enter,...

    With scanf() I need to press a character, Enter, and then another character which is the option from the menu to run the switch statement.
  15. Replies
    6
    Views
    27,213

    Well actually It prints once and then runs the...

    Well actually It prints once and then runs the default case and prints again.
  16. Replies
    6
    Views
    27,213

    Reading a character from the keyboard getchar()

    hello all

    In a do while I'm printing a menu, getting a character from the keyboard and run a switch statement in the cases where that character is "d, v or f". the condition executes until the...
Results 1 to 16 of 16