Search:

Type: Posts; User: nonoob

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds; generated 9 minute(s) ago.

  1. The else { col = i; ...

    The
    else
    {
    col = i;
    }
    should be
    else
    col = input[i] - '0' because you are wanting the numeric equivalent of digits '0' to '9'.

    Also you'd want to...
  2. Replies
    3
    Views
    765

    Scanf requires address of variable. e.g....

    Scanf requires address of variable. e.g. scanf("%f", &length_one_side);
  3. Replies
    3
    Views
    589

    It would be helpful if you showed us how you...

    It would be helpful if you showed us how you declared the 'map' array. Are you sure you wanted it char? Each element should contain what exactly? An integer, a single char, a string? You mentioned...
  4. Replies
    4
    Views
    902

    Try this intchange = GetFloat()*100+0.5 to...

    Try this
    intchange = GetFloat()*100+0.5 to round it to nearest cent.
  5. Replies
    14
    Views
    3,356

    I the function header void printReceipt (const...

    I the function header void printReceipt (const MenuData menu[], int qty, info) - what is 'info'? It's not a basic data type. So where is the formal parameter?
    Also, can you show the part of 'main'...
  6. Replies
    2
    Views
    1,821

    'item' is a localized variable in function...

    'item' is a localized variable in function SLCreate. You can not expect its contents to remain after you exit the function as it is on the stack only. You are attempting to return its address - but...
  7. Thread: Array Lengths

    by nonoob
    Replies
    13
    Views
    1,206

    Slight correction: it's treated as an octal value.

    Slight correction: it's treated as an octal value.
  8. Replies
    6
    Views
    1,886

    January 1, 2001 = Monday. So in 2002 it would...

    January 1, 2001 = Monday.
    So in 2002 it would be?
    add 365 days - which is like adding exactly 52 weeks + 1 day. 52 x 7 + 1 = 365.
    So the weekday slips ahead one day from Monday to Tuesday.
    Then...
  9. Try %llf instead of %Lf everywhere.

    Try %llf instead of %Lf everywhere.
  10. You can try looking for "wait" or "delay" type...

    You can try looking for "wait" or "delay" type function. Or you can write a loop that queries the system time until it elapses some interval from a start point.
  11. Replies
    17
    Views
    2,430

    num = rand()%5; gives 0 to 4. So in one out of 5...

    num = rand()%5; gives 0 to 4. So in one out of 5 cases none of the 'else' code (or Codeplug's cases) is executed.
  12. Replies
    13
    Views
    1,743

    Read the requirement. Although in its current...

    Read the requirement. Although in its current form the array is static, it will need to be changed to comply with what was asked for.
  13. Replies
    13
    Views
    1,743

    Yes you can send rows to the bubble() function...

    Yes you can send rows to the bubble() function like that. Note that you pass matrix[i] which is an entire row. Therefore matrix[i] must be a pointer to an allocated area that holds a row's worth of...
  14. Thread: Sorting struct

    by nonoob
    Replies
    5
    Views
    4,290

    Figuring out a working sort algorithm is one...

    Figuring out a working sort algorithm is one issue. Work on that for simple number arrays.
    Then when handling structs you need to flip entire struct records instead of just an int. Or at least flip...
  15. Replies
    14
    Views
    1,487

    I should have rotated it slightly to show a nicer...

    I should have rotated it slightly to show a nicer pattern: A-B-AA-BB
    This is equivalent to the earlier one.

    I wonder if ants or snails have sophisticated enough mechanics to generate chemical...
  16. Replies
    14
    Views
    1,487

    A-B-B-A-B-A (repeat)

    A-B-B-A-B-A (repeat)
  17. Thread: Rounding help

    by nonoob
    Replies
    4
    Views
    1,097

    Multiply by 100 1.85458 x 100 = 185.458 Then...

    Multiply by 100
    1.85458 x 100 = 185.458

    Then round to nearest integer using method you said you had -> 185
    Then divide by 100 -> 1.85
  18. Then replace 'int' declarations with 'long' to...

    Then replace 'int' declarations with 'long' to force it to use 32-bit integers. Use %ld in print format specifier.
  19. For the fraction: Isn't it just the number of...

    For the fraction:
    Isn't it just the number of '1's in the fractional part (to the right of the implied decimal point) divided by 2^n where n is the same number.

    For example: .101 = 5 / 2^3 = 5...
  20. Replies
    5
    Views
    901

    Logic is not right. Will return "is prime" before...

    Logic is not right. Will return "is prime" before all divisors are checked.
  21. Yes it's structure element packing. The uint you...

    Yes it's structure element packing. The uint you had is padded by 2 bytes to align the next element on a nice machine-friendly boundary... probably 4 byte chunks. You can try #pragma pack before the...
  22. Thread: garbage value

    by nonoob
    Replies
    6
    Views
    2,575

    Buffers are just arrays. If you don't initialize...

    Buffers are just arrays. If you don't initialize its elements then they may contain garbage.
    Exception is that if the array is declared global then it is initialized to all zeros for you.
  23. Replies
    3
    Views
    805

    ptr = (int *)*ptr_address

    ptr = (int *)*ptr_address
  24. Replies
    3
    Views
    2,324

    There exists a larger palindrome product of two...

    There exists a larger palindrome product of two 7-digit numbers:

    9998017 * 9997647 = 99956644665999

    8-digit:
    99999999 * 99990001 = 9999000000009999

    9-digit:
    999980347 * 999920317 =...
  25. Replies
    8
    Views
    2,280

    You have to research the formula that you...

    You have to research the formula that you require. Something like Vc = V * (1- e^(-t / R*C))
    Resistance, Capacitance, Voltage, And Time Calculator
    RC Time Calculator
    I'm not sure how the...
Results 1 to 25 of 499
Page 1 of 20 1 2 3 4