Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.21 seconds.

  1. Replies
    6
    Views
    146

    > I see, so in this particular instance I would...

    > I see, so in this particular instance I would need some form of internal error level check to establish the file to be read
    > is in the first place a text-file in composition & not for e.g. a...
  2. Replies
    1
    Views
    70

    Because str4 doesn't have a \0 to mark the end of...

    Because str4 doesn't have a \0 to mark the end of the string.

    So printf just keeps running through memory until it finds a \0.

    In your case, that just happened to be your str3.

    But it could...
  3. Replies
    7
    Views
    144

    > btw how do you shut down gdb without closing...

    > btw how do you shut down gdb without closing the terminal as no matter what basic sense command I tried nothing worked
    Try the 'quit' command.

    > I didn't want to keep typing shared_mem and...
  4. Replies
    5
    Views
    151

    You're confused, because it's a crap example to...

    You're confused, because it's a crap example to work from to begin with.

    The program is off in the weeds somewhere as soon as it starts doing anything with p+1

    Draw out some memory diagrams...
  5. Replies
    6
    Views
    146

    > so if I am reading you correctly for medium to...

    > so if I am reading you correctly for medium to long term use dev-cpp is kinda ring fenced to XP & is only really suitable for say small programs below say < 64Kb.
    No, the IDE part is crap.
    You...
  6. Replies
    7
    Views
    144

    The first thing I would do is rip out all that...

    The first thing I would do is rip out all that ifdef WIN32 rubbish until you've got the POSIX version working properly.

    Next,
    #define P_RD 0
    #define P_WR 1
    so things like
    wrpipe(...
  7. Replies
    6
    Views
    146

    > so then I installed, after a further...

    > so then I installed, after a further recommendation DEV-CPP V4.9.9.2 as it is allegedly better suited or easier for beginners to navigate and understand in terms of usage?
    Not really, it's just...
  8. Replies
    1
    Views
    86

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

    I would suggest you do


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

    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.
  10. 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...
  11. >...

    > 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);
  12. Replies
    5
    Views
    162

    Well which compiler / IDE are you using?

    Well which compiler / IDE are you using?
  13. Replies
    5
    Views
    162

    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;
  14. 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...
  15. 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.
  16. > 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...
  17. > 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...
  18. Replies
    1
    Views
    102

    > 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...
  19. > 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.
    ...
  20. Thread: Student database

    by Salem
    Replies
    10
    Views
    302

    > 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...
  21. Thread: Student database

    by Salem
    Replies
    10
    Views
    302

    > 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?
  22. Thread: Student database

    by Salem
    Replies
    10
    Views
    302

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

    > if(list[i].gender == male)
    Use strcmp() to compare strings.
  23. #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.
  24. Thread: Student database

    by Salem
    Replies
    10
    Views
    302

    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...
  25. A for loop with a[i] = -a[i]; perhaps?

    A for loop with a[i] = -a[i]; perhaps?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4