Search:

Type: Posts; User: dheaven

Search: Search took 0.00 seconds.

  1. You should probably use strtok in order to divide...

    You should probably use strtok in order to divide your string into substrings (see here a tutorial on how to use strtok properly).
    Then, you will probably need to put them into a string array and...
  2. Replies
    14
    Views
    5,040

    Try using Quick'n'Dirty bitmap. It's a nice...

    Try using Quick'n'Dirty bitmap. It's a nice library that can help you manipulate bitmaps and it also quite fast.
    QDBMP

    Also, it has a tutorial of how to negate an image.

    Good luck!
  3. Replies
    6
    Views
    1,356

    You should use strcpy instead of = as in:...

    You should use strcpy instead of = as in:
    strcpy(tempword,words[0]->word).

    Check this out for more info:
    Dystopian Code: Concatenating, Copying and Comparing Strings in C
  4. Thread: Qestion.. (:

    by dheaven
    Replies
    14
    Views
    1,469

    You should probably do it with a for loop since...

    You should probably do it with a for loop since for loops are usually used when you know how many iterations will be done.
  5. Replies
    4
    Views
    2,545

    You should try reading this: Dystopian Code:...

    You should try reading this:
    Dystopian Code: Console I/O using stdio in C\C++
    Dystopian Code: Formatted Strings in C\C++

    A correct printf would be:


    int x = 43;
    printf("I am currently %d...
  6. Thread: C Homework

    by dheaven
    Replies
    29
    Views
    4,206

    Here are some tutorials that might help you...

    Here are some tutorials that might help you especially if you want to use dynamic arrays:
    Dystopian Code: Defining a Numeric Array Structure in C
    Dystopian Code: The Minimum and Maximum Element of...
  7. Replies
    4
    Views
    2,406

    Read about the conditional operator here:...

    Read about the conditional operator here:
    Dystopian Code: The Conditional Operator
  8. Replies
    12
    Views
    3,091

    I think that you will find these articles useful....

    I think that you will find these articles useful. They are about an array structure that uses dynamic allocation.
    Dystopian Code: Defining a Numeric Array Structure in C
    Dystopian Code: Dynamic...
  9. Replies
    7
    Views
    1,950

    You may also find these tutorials useful:...

    You may also find these tutorials useful:
    Dystopian Code: Bitwise Operators in C
    Dystopian Code: Bitwise Shifts and Rotations in C
    Dystopian Code: How to Set, Clear, Check, Toggle and Copy Bits
  10. Replies
    2
    Views
    944

    If you want to learn more about boolean...

    If you want to learn more about boolean operators, you may find these tutorials useful:
    Dystopian Code: Bitwise Operators in C
    Dystopian Code: How to Set, Clear, Check, Toggle and Copy Bits...
  11. Replies
    6
    Views
    5,426

    If you really want to hold them into a single...

    If you really want to hold them into a single array you could create a larger array and concatenate each input using strcat. You could use a separator between them and use strtok when you want to...
  12. Your code is not pretty well formatted. Also, you...

    Your code is not pretty well formatted. Also, you may want to make your matrix a dynamic 2D array (static allocation is not very good when you deal with large numbers). Also, you may want to add a...
  13. Replies
    22
    Views
    19,267

    You could use puts instead of printf when you...

    You could use puts instead of printf when you only want to print a string to console.
    See this tutorial for more on how to create menus:
    Dystopian Code: Creating a Console Menu in C\C++
  14. Replies
    3
    Views
    2,006

    You could use itoa to obtain directly the number...

    You could use itoa to obtain directly the number in binary as a char array.

    Check this tutorial out:
    Dystopian Code: Radix Conversion in C
    See here itoa reference:
    itoa - C++ Reference
  15. Thread: Binary Output

    by dheaven
    Replies
    13
    Views
    2,277

    To print a value in binary you could use itoa and...

    To print a value in binary you could use itoa and specify the base. You could also create your own function, if you want to obtain the result as a long long or a long.

    You may find this tutorial...
  16. Replies
    6
    Views
    4,364

    If you need to populate an array who has an...

    If you need to populate an array who has an unknown size, you may need to use dynamic memory allocation (dynamic arrays).

    To declare the array as dynamic : int* num (this may solve some of your...
  17. Replies
    8
    Views
    788

    I don't know if the code is correct since, to my...

    I don't know if the code is correct since, to my knowledge, the bit shift operators (>>) take only integer arguments. You may be able to use a float or a double as a argument if you cast it first to...
  18. You may find these tutorial useful: Basic...

    You may find these tutorial useful:

    Basic matrix know-how
    Dystopian Code: How to Create, Assign Values to and Output a Matrix in C

    Other matrix tutorials (sum, product, etc) that operate with...
  19. You need first to intialize your array (the xMax...

    You need first to intialize your array (the xMax dimension). Then you need to initialize every row (the yMax dimension). After you done that you can use it like a normal array. Also, you may find...
  20. Replies
    9
    Views
    6,961

    There are many array searching algorithms. You...

    There are many array searching algorithms.
    You can read about them here (source + explications): Foobar: Array Searching Algorithms in C
  21. Replies
    2
    Views
    822

    Examples from Using MPI, 2nd edition...

    Examples from Using MPI, 2nd edition
    MPI - C++ Examples
    Some MPI Examples
  22. Replies
    9
    Views
    43,889

    %2d means that if the number is smaller than two...

    %2d means that if the number is smaller than two spaces (__), there would be an extra space left to the left.
    So, if you have


    printf("%d", 1);
    //The output will be:
    //1

    But if you have
  23. Thread: Float to ASCII

    by dheaven
    Replies
    24
    Views
    42,332

    If you want to convert an float to a string you...

    If you want to convert an float to a string you could use sprintf.


    float myFloat = 3.23;
    char myString[30];
    sprintf(myString, "%f", myFloat);

    See more at sprintf - C++ Reference
Results 1 to 23 of 23