Search:

Type: Posts; User: happycoder

Search: Search took 0.01 seconds.

  1. Thread: C++ Help

    by happycoder
    Replies
    3
    Views
    1,241

    just start the for loop at 0, like this: ...

    just start the for loop at 0, like this:



    for (j = 0; j < 10; j++)
    cout << “Inventory Item # “ << j << “ has “ << n[j] << “ items remaining.” << endl;
  2. Replies
    4
    Views
    1,034

    if im reading you correctly, you are trying to: ...

    if im reading you correctly, you are trying to:

    1. create a new string the size of data
    2. copy the contents of data to the new string

    try replacing


    char content[strlen(data)] = data;
  3. Thread: Structures

    by happycoder
    Replies
    4
    Views
    1,078

    if youre using C, yes. but in C++, there is no...

    if youre using C, yes. but in C++, there is no need. just saying


    struct NewQ {
    ...
    };

    already defines a new type NewQ.
  4. Replies
    6
    Views
    18,233

    since 16 is decimal and 016 is octal, they will...

    since 16 is decimal and 016 is octal, they will never be equal.



    ah yes, i remember reading this in c by disection 2nd ed.

    hey, maybe its time i polish on my basic c++
  5. Replies
    6
    Views
    18,233

    it sure did! hex literals are most suited for...

    it sure did! hex literals are most suited for bitwise flags, got it!

    i asked this question bec. i remember reading from my text books that an integer literal constant is always treated as a...
  6. Replies
    6
    Views
    18,233

    use of hex literal constant

    hi, i always initialize enum members with integer values. sometime ago, i ran accross some header files of the Qt gui toolkit. instead of integer constants, they use hex constatns.

    eg.


    ...
Results 1 to 6 of 6