Search:

Type: Posts; User: skiabox

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,275

    In fact my program is ok. The problem was the...

    In fact my program is ok.
    The problem was the text file that was large but with only 5 or 6 \n characters. (I can't express it in another way- it is when you press enter when you write the text...
  2. Replies
    5
    Views
    1,275

    ok I managed to read the file in the debugger...

    ok I managed to read the file in the debugger console, but I don't get the 24 lines pause.
    Any ideas?
  3. Replies
    5
    Views
    1,275

    ifstream problem

    Here is the code :



    #include <iostream>
    #include <fstream>
    #include <string>
    using namespace std;

    int main (int argc, char * const argv[]) {
  4. Replies
    4
    Views
    3,291

    const worked, but what if you want to change an...

    const worked, but what if you want to change an item?
  5. Replies
    4
    Views
    3,291

    Warning from xcode

    I am using xcode 3.2.5 and I am reading C++ Without Fear.
    At the chapter five there is this code from the author :



    #include <iostream>
    #include <stdlib.h>
    #include <time.h>
    #include...
  6. Thread: array question

    by skiabox
    Replies
    3
    Views
    1,298

    I suppose that we can omit x or y if one of the...

    I suppose that we can omit x or y if one of the two is zero.
    See this code that I get from a book I am reading :


    for (i = 0; i < 9; i++)
    if (planets[i][0] == 'M')
    printf("%s begins...
  7. Thread: array question

    by skiabox
    Replies
    3
    Views
    1,298

    array question

    I have seen a two dimensional array[x][y] to be used in the code like this : array[i]
    When it is used like this we mean that we only refer to the row and that the column is zero?
    Thank you.
  8. Replies
    2
    Views
    1,152

    getchar() question

    I have seen in different text/source code that a variable that will get the getchar() result is declared in some code listings as int and in other code listings as char.
    Which is the proper...
  9. Replies
    2
    Views
    1,200

    You were right.I thought it should be declared as...

    You were right.I thought it should be declared as an int because it is used as a counter.
    Thank you for your help.
  10. Replies
    2
    Views
    1,200

    Reverse a message using pointers.

    I am trying to reverse a message using pointers but I get only the last character of the message.
    Here's the code :



    #include <stdio.h>
    #include <stdbool.h>
    #include <stdlib.h>

    int main...
  11. Replies
    5
    Views
    8,207

    (*pairs)++ worked! Thanks a lot guys for your...

    (*pairs)++ worked!
    Thanks a lot guys for your time and your clear explanations!
  12. Replies
    5
    Views
    8,207

    It doesn't seem to work. Here's the complete...

    It doesn't seem to work.
    Here's the complete code list :



    //Classifies a poker hand

    #include <stdio.h>
    #include <stdlib.h>
    #include <stdbool.h>
  13. Replies
    5
    Views
    8,207

    Increment a pointer variable

    I am calling a function that contains an int pointer as an argument :

    function (int *p)

    How can I increase the pointer value by 1?

    *p++ is not working;

    Thank you.
  14. Replies
    4
    Views
    1,002

    Thank you msh.Your code worked! Many thanks!!!

    Thank you msh.Your code worked!
    Many thanks!!!
  15. How to get a y or n answer without the newline character

    How can I get a y or n answer from the user without messing with newline character.
    The following code fails in this because the second getchar gets the newline character from the previous answer:
    ...
  16. Replies
    4
    Views
    1,002

    Thnx a lot for your help.I am trying now to solve...

    Thnx a lot for your help.I am trying now to solve the problem with the newline character and the getchar() command.
  17. Replies
    4
    Views
    1,002

    Problem with computer speed?!

    I wrote a solution for the game of craps.
    Here is how it is played :

    Each round has two phases: "come-out" and "point". To start a round, the shooter makes one or more "come-out" rolls. A...
  18. Replies
    11
    Views
    3,651

    Ok I solved the problem using this code : (I...

    Ok I solved the problem using this code : (I can't see the array elements in debugging mode but it works)




    #include <stdio.h>
    #include <stdbool.h>

    int main (int argc, const char * argv[])...
  19. Replies
    11
    Views
    3,651

    http://i51.tinypic.com/2ekko5g.png

    http://i51.tinypic.com/2ekko5g.png
  20. Replies
    11
    Views
    3,651

    I am using gnu99 compiler.I am reading a book and...

    I am using gnu99 compiler.I am reading a book and it says that in c99 it is ok to use variable length arrays.
  21. Replies
    11
    Views
    3,651

    Problem with variable length array

    Well here's the code :



    #include <stdio.h>
    #include <stdbool.h>

    int main (int argc, const char * argv[]) {
    // insert code here...
    int size;
  22. Replies
    1
    Views
    1,724

    How to debug putchar()

    I am trying to debug putchar with xcode but I can't see the characters in the console window?
    Any ideas on this one?
  23. Replies
    5
    Views
    5,467

    This is my latest version (not perfect yet) : ...

    This is my latest version (not perfect yet) :



    #include <stdio.h>
    #include <stdbool.h>
    #include <stdlib.h>
    #include <time.h>

    int main (int argc, const char * argv[]) {
  24. Replies
    5
    Views
    5,467

    This is a solution but it does not work at all...

    This is a solution but it does not work at all times and I can't find a logical flow in the code.
    Any ideas?



    #include <stdio.h>
    #include <stdbool.h>
    #include <stdlib.h>
    #include <time.h>
  25. Replies
    5
    Views
    5,467

    I made the classic mistake of == instead of =....

    I made the classic mistake of == instead of =.
    Sorry!!
    :(
Results 1 to 25 of 37
Page 1 of 2 1 2