Search:

Type: Posts; User: DRK

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. (*(*(*pMyMT).next).next).next = pMyMT4;

    (*(*(*pMyMT).next).next).next = pMyMT4;
  2. Thread: can you gut

    by DRK
    Replies
    8
    Views
    4,466

    You should include stdlib.h instead of declaring...

    You should include stdlib.h instead of declaring standard library functions on your own.
  3. Replies
    3
    Views
    6,820

    The compiler tells exactly what the problem is -...

    The compiler tells exactly what the problem is - you provided some identifiers (red, green, blue) which were not previously declared. switch-case instruction handles only integer values, so you need...
  4. Replies
    4
    Views
    3,002

    Obviously you need to learn how printf...

    Obviously you need to learn how printf works. Focus on %x format specifier.
  5. Replies
    3
    Views
    642

    1. Define a set in which you can store unique...

    1. Define a set in which you can store unique result values.

    #include <set>

    set<int> result; // at the beginning of function main

    if (digits_i == digits_v)
    {
    if (result.count(v) == 0)...
  6. Replies
    4
    Views
    1,616

    #include void print_slice(const char...

    #include <stdio.h>

    void print_slice(const char *str, unsigned int begin, unsigned int end)
    {
    printf("%.*s", end - begin, str + begin);
    }
  7. Replies
    6
    Views
    881

    Your algorithm is implemented correctly. The...

    Your algorithm is implemented correctly. The runtime error is caused by an other instruction. Maybe you are trying to reverse a string which is a constant literal? You need show the rest of the code.
  8. Replies
    3
    Views
    3,526

    MQTTClient_create is probably defined in some...

    MQTTClient_create is probably defined in some library which you need to link in the compiler options.
  9. 1.Correct function headers: float average(int...

    1.Correct function headers:

    float average(int *a, int N)

    float var(int *a, float average)
    2. var is a function name and its address, so you cannot assign to it any value.

    for (i=0;i<N;i++)...
  10. The conditional statement you created else if...

    The conditional statement you created

    else if (sum / 3 + 1 && 3 + 2 && 3 + 3 == 3)
    is equivalent to

    else if ((sum / 3 + 1) != 0 && true && false)
    which will be evaluated always as

    else if...
  11. Replies
    7
    Views
    626

    You've almost got it. Take a look how you can use...

    You've almost got it. Take a look how you can use stringstream.

    int main()
    {
    string name = "George";
    int num = 4;
    stringstream ss;
    ss << name << "_" << num;
    string result...
  12. Replies
    9
    Views
    1,081

    The algorithm is wrong as it prints out numbers 0...

    The algorithm is wrong as it prints out numbers 0 and 1 which are not prime.
  13. The correct statement would be: if (number[k]...

    The correct statement would be:

    if (number[k] > number[i])
    {
    k = i;
    }
  14. Replies
    9
    Views
    2,960

    That conditional is not quite right as 0 is...

    That conditional is not quite right as 0 is neither positive nor negative.
  15. 1. These function definitions float volume...

    1. These function definitions


    float volume (float r & h)
    float surface_area (float r & c)

    are invalid and don't match the prototypes:


    float volume (float);
  16. It is possible using GCC Statement Exprs - Using...

    It is possible using GCC Statement Exprs - Using the GNU Compiler Collection (GCC)


    #define EXISTS(T, a, n, val) ({\
    char ret = 0;\
    T *a_ = (a);\
    size_t n_ = (n);\
    T val_ =...
  17. In main you need to allocate memory to pointer p...

    In main you need to allocate memory to pointer p before assigning values to structure members.
  18. Replies
    4
    Views
    916

    for (i = 9, j = 0; i > 0 && j < 10; i--, j++)

    for (i = 9, j = 0; i > 0 && j < 10; i--, j++)
  19. Replies
    5
    Views
    969

    How is your question related to my post?

    How is your question related to my post?
  20. Replies
    5
    Views
    969

    1. Make up your mind on the format of a valid...

    1. Make up your mind on the format of a valid phone number. In the post you provided (xxx)-xxx-xxxx, but in the code you are missing a dash.
    2. Your function will return 1 if the input string is...
  21. Replies
    2
    Views
    821

    You are leaking memory: stack = new...

    You are leaking memory:

    stack = new rbNode*[depth + 1];
    int* dir;
    dir = new int [depth + 1];

    if (!root)
    {
    printf("Tree not available\n");
    return;
  22. Replies
    4
    Views
    870

    You need to include string.h header file to use...

    You need to include string.h header file to use functions like strcmp.

    int nlguess = 0;
    for (i = 0; i < slength; ++i)
    {
    if (word[i] == lguess)
    {
    ++nlguess;
    }
    }
  23. Replies
    5
    Views
    2,558

    The explanation of your logic is not quite clear....

    The explanation of your logic is not quite clear. How is row #1 in the 2D array the closest to 1D array when it's difference of 18 is the highest? Shouldn't be row #2 the closest with the lowest...
  24. Replies
    10
    Views
    4,003

    1. In that loop you keep overwriting content of...

    1. In that loop you keep overwriting content of the array.

    2. Don't use gets as you can't control the size of the input string, use fgets instead.

    3. Since the task requires the array to be...
  25. Replies
    5
    Views
    710

    You need to pass address of an array, not value...

    You need to pass address of an array, not value of its single element.

    funct(A,2,5);
Results 1 to 25 of 121
Page 1 of 5 1 2 3 4