Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.20 seconds; generated 59 minute(s) ago.

  1. Thread: Help!!!

    by Salem
    Replies
    1
    Views
    62

    Use meaningful, specific subject headers...

    Use meaningful, specific subject headers
    Don't post homework questions
    If you want help, you need to make an effort.

    Figuring out how to use "bold" doesn't qualify as effort.
  2. Replies
    5
    Views
    129

    > It has to be on the same array since this is...

    > It has to be on the same array since this is payload I have to transmit.
    Transmit where (and how)?

    Network send() for example won't care whether it's one buffer or two, if you decide to send...
  3. Replies
    2
    Views
    155

    > int **arr = calloc(N, sizeof(int *)); > ...

    > int **arr = calloc(N, sizeof(int *));
    > arr = calloc(N, sizeof(int));
    You have two things called 'arr' going on at the same time.

    > max = arr[j];
    > arr[j] =...
  4. The way you handle the return results of all your...

    The way you handle the return results of all your send/recv calls are wrong.

    Neither guarantee complete success or complete failure. You have to deal with partial success as well.

    n =...
  5. Replies
    2
    Views
    140

    > scanf("%s%*c", &yesNo); The %s conversion...

    > scanf("%s%*c", &yesNo);
    The %s conversion needs at least TWO characters of storage
    - the char you type
    - the \0 character.

    Perhaps with a leading space to %c, you can get what you want....
  6. Replies
    1
    Views
    98

    to convert two-dimensional array to...

    to convert two-dimensional array to one-dimensional

    No thoughts at all as to how to go about this?
    Just dumping your assignment isn't going to make us write all the code for you.
  7. Is your ISR attached to your button or your PWM...

    Is your ISR attached to your button or your PWM pin?

    I'm guessing you have something like this to test on (for example).
    AVR Development Kit - Tutorials

    It would be really useful if you posted...
  8. So is it like this? - press (and release)...

    So is it like this?

    - press (and release) button, PWM pattern 1 starts.
    - press (and release) button, PWM pattern 1 stops.
    - press (and release) button, PWM pattern 2 starts.
    - press (and...
  9. Thread: Beginner help

    by Salem
    Replies
    3
    Views
    125

    1. Make all your functions return a proper type....

    1. Make all your functions return a proper type.
    2. There's no benefit to writing code all on one line.
    3. There's no benefit in abusing the comma operator.
    4. There's no need for a trailing ; at...
  10. > Modify the delete_from_list function so that is...

    > Modify the delete_from_list function so that is uses only one pointer variable instead of two (cur and prev).
    I'm always suspicious of books / tutors that try to teach magic tricks as opposed to...
  11. If your list is 1 -> 2 -> 3 -> 4 -> 5 and you...

    If your list is
    1 -> 2 -> 3 -> 4 -> 5
    and you try to delete 3 by doing this
    *list = item->next;

    You end up with 4 -> 5 as your list.

    Typically, you need to keep track of the previous node as...
  12. > while (isspace(ch = getchar())) > ; > ...

    > while (isspace(ch = getchar()))
    > ;
    > while (ch != '\n' && ch != EOF) {
    The problem is that isspace('\n') is true, so you're not getting out of the first loop by typing a blank line....
  13. > void main() ... > fflush(stdin); ... > ...

    > void main()
    ...
    > fflush(stdin);
    ...
    > gets(keystr);
    My first thought would be to find someone not stuck with a 1980's DOS mentality to copy/steal code from.

    > I know that it is a...
  14. Replies
    2
    Views
    179

    Did you research the topic before you started...

    Did you research the topic before you started coding?
    Maze solving algorithm - Wikipedia
  15. Replies
    4
    Views
    180

    Try something like if ( ItemChosen == 'O' )...

    Try something like


    if ( ItemChosen == 'O' ) {
    if ( Orange <= budget ) {
    }
    }
  16. Replies
    4
    Views
    180

    Post your code.

    Post your code.
  17. Replies
    5
    Views
    164

    How To Ask Questions The Smart Way...

    How To Ask Questions The Smart Way
    How To Ask Questions The Smart Way
    Make an effort!
    Show us what you're able to manage yourself, then ask a question about the code you have.

    Don't just roll...
  18. Some fun for a lazy Saturday :) ...

    Some fun for a lazy Saturday :)


    #include<stdio.h>

    #define ASIZE 5

    void zigzag(int a[ASIZE][ASIZE]) {
    int flip = 0;
    for( int r = 0 ; r < ASIZE ; r++ ) {
  19. > Thanks. fixed those but there still is the...

    > Thanks. fixed those but there still is the segfault.
    At some point, you have to recognise that the current list is empty (head == NULL), and just return the freshly created node as being the sole...
  20. You need to make sure your new_node->next is...

    You need to make sure your new_node->next is NULL.

    > SinglyLinkedListNode *new_node = (SinglyLinkedListNode*)malloc(sizeof(SinglyLinkedListNode));
    If this really is C++, then you should be using...
  21. Do you want to make a copy of the data? int...

    Do you want to make a copy of the data?


    int from[3][3];
    int to[9];
    // some code to copy from -> to


    Or you do want to modify the array in place, then pretend it's a 1D array by pointing to...
  22. So you want to flatten 1 2 3 4 5 6 7 8 9 ...

    So you want to flatten
    1 2 3
    4 5 6
    7 8 9

    into
    1 2 3 6 5 4 7 8 9
    ?
  23. Replies
    2
    Views
    174

    If it frees all the memory you allocated during a...

    If it frees all the memory you allocated during a normal exit, that should be fine.

    Freeing all the memory in various exception cases is rather more involved.
  24. Which compiler are you using?

    Which compiler are you using?
  25. Replies
    4
    Views
    153

    Try compiling with some warnings. $ gcc...

    Try compiling with some warnings.


    $ gcc -Wall main.c
    main.c:2:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
    void main()
    ^
    main.c: In function ‘main’:
    main.c:6:16: warning:...
Results 1 to 25 of 497
Page 1 of 20 1 2 3 4