Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.19 seconds; generated 8 minute(s) ago.

  1. Replies
    1
    Views
    19

    I would suggest you do case '1': ...

    I would suggest you do


    case '1':
    doInsects();
    break;
    case '2':
    doBirds();
    break;
    case '3':
  2. Replies
    5
    Views
    114

    So am I. So you've already seen how I use gcc....

    So am I.
    So you've already seen how I use gcc.
    Now you can do the same.
  3. struct pcap_user_data { new_activity_list_t...

    struct pcap_user_data
    {
    new_activity_list_t *new_activity_list;
    process_packet_options_list_t *process_packet_options_list;
    };
    typedef struct pcap_user_data...
  4. >...

    > pthread_mutex_init(&pcap_user_data->new_activity_list->mutex,NULL);
    I figure it should be
    pthread_mutex_init(&pcap_user_data->new_activity_list.mutex,NULL);
  5. Replies
    5
    Views
    114

    Well which compiler / IDE are you using?

    Well which compiler / IDE are you using?
  6. Replies
    5
    Views
    114

    1, indentation really helps to see what's going...

    1, indentation really helps to see what's going on.


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

    int main()
    {
    int Option, ResCount, Resistors, ResValue, ResTotal;
    ResCount = 0;
  7. Yeah, 500 lines of poorly formatted code...

    Yeah, 500 lines of poorly formatted code containing goto's is not a good start.

    You have a lot of printf's in there, perhaps you could post those as well.
    Bear in mind that either we can't run...
  8. You need to return the new length of the array,...

    You need to return the new length of the array, after you've removed the duplicates.
  9. > Enter the number of digits : 4 Presumably, you...

    > Enter the number of digits : 4
    Presumably, you used scanf with %d to read this.

    > Enter the number in binaries : 1001
    What did you use to read this?

    One you have a sequence of 0 and 1, then...
  10. > Always a good idea to give a hand to the...

    > Always a good idea to give a hand to the compiler,
    Or a bad idea.

    If you write overly micro-managed "efficient" code, you typically subvert the ability of the optimiser to see through your...
  11. Replies
    1
    Views
    77

    > direction += rotation; > double ax =...

    > direction += rotation;
    > double ax = acceleration * cos(direction);
    > double ay = acceleration * sin(direction);
    The first question to ask would be what units your angles are measured...
  12. > for example L = [3, 2, 7, 5, 8] > if I wanna...

    > for example L = [3, 2, 7, 5, 8]
    > if I wanna find successor for 3 it has to be bigger than 3 but smaller than other numbers which is 5.
    The question is only meaningful if the list is sorted.
    ...
  13. Thread: Student database

    by Salem
    Replies
    10
    Views
    280

    > sum_age = sum + list[i].age; Where is this...

    > sum_age = sum + list[i].age;
    Where is this declared in your code?
    At best, it's some messy global variable.
    At worst, it's undeclared and your code doesn't even compile.



    void...
  14. Thread: Student database

    by Salem
    Replies
    10
    Views
    280

    > int sum_age; What is the initial value of...

    > int sum_age;
    What is the initial value of sum_age?

    > sum_age = sum + list[i].age;
    What is sum here?
    Where did you declare it?
  15. Thread: Student database

    by Salem
    Replies
    10
    Views
    280

    > if(list[i].gender == male) Use strcmp() to...

    > if(list[i].gender == male)
    Use strcmp() to compare strings.
  16. #define FALSE 0u #define TRUE (~FALSE) TRUE...

    #define FALSE 0u
    #define TRUE (~FALSE)

    TRUE becomes all bits set in whatever width of data type you end up assigning it to.
  17. Thread: Student database

    by Salem
    Replies
    10
    Views
    280

    Regarding delete void Delete(personaData...

    Regarding delete


    void Delete(personaData list[50], int x)
    {
    int pnum;
    printf("Enter a personal number:");
    scanf("%d", pnum);
    char emptyStr[20] = {"\0"};
    int...
  18. A for loop with a[i] = -a[i]; perhaps?

    A for loop with a[i] = -a[i]; perhaps?
  19. > printf("%d\n", &length); // prints 6422272 ...

    > printf("%d\n", &length); // prints 6422272
    Because you don't use & when printing a value.

    > for(i = 0; i <= length; i++)
    Arrays run from 0 to length-1
    So we usually say
    for(i = 0; i <...
  20. Which compiler / IDE are you using? If you're...

    Which compiler / IDE are you using?

    If you're compiling from the command line, all you need is
    g++ main.cpp operator.cpp
  21. So, do you have any code to start with? Just...

    So, do you have any code to start with?

    Just dumping your assignment on us with zero effort isn't good.
  22. Thread: Programm C fix

    by Salem
    Replies
    5
    Views
    295

    > On the Y axis the temperature should appear and...

    > On the Y axis the temperature should appear and on the X axis the 100 steps.
    So you should only be outputting pairs of numbers to begin with.

    Using strtok is messy, because you also need to...
  23. Replies
    4
    Views
    274

    > There is no operator present. But in the...

    > There is no operator present.
    But in the context of an expression requiring a boolean expression,
    while(numbers[ball])
    is the same as
    while(numbers[ball] != 0)

    Since you then go onto do...
  24. Thread: Tricky typedef

    by Salem
    Replies
    5
    Views
    292

    Do you have some context for the question? >...

    Do you have some context for the question?

    > What can be the usage of this?
    Typedef'ing a function pointer is very common.

    Primarily because they're quite complicated to get right, and they...
  25. Thread: Tricky typedef

    by Salem
    Replies
    5
    Views
    292

    cdecl: C gibberish English...

    cdecl: C gibberish <-> English
    It's a function pointer.
Results 1 to 25 of 494
Page 1 of 20 1 2 3 4