Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

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

  1. Replies
    5
    Views
    78

    > for(i=0,j=0;i

    > for(i=0,j=0;i<=k,j<=n;i++)
    Well one reason would be that you're accessing outside the bounds of the array.
    You should have <, not <= in your loops.
  2. Replies
    5
    Views
    78

    k=99999; int answer[n]; int numbers[k];...

    k=99999;
    int answer[n];
    int numbers[k];
    //int *current;
    //current = (int*)malloc(n * sizeof(int));
    int current[k];

    The stack isn't an infinite amount of space you can...
  3. Replies
    10
    Views
    313

    > usually I’m able to read my books and figure it...

    > usually I’m able to read my books and figure it out
    Well you should be at the stage where you can figure out what compiles and what doesn't.

    How do we identify in your pseudo code anything...
  4. Replies
    17
    Views
    328

    > don't know why you need the terminator when...

    > don't know why you need the terminator when you know how many numbers are in the array.
    Because that's what the assignment said to use.
  5. Replies
    6
    Views
    117

    > GetValue(&m1[ROWS][COLS],...

    > GetValue(&m1[ROWS][COLS], &m2[ROWS][COLS], temp, temp1, i);
    This isn't how you pass on your input parameters.



    GetValue(m1, m2, temp, temp1, i);


    > multiply(&m1[ROWS][COLS],...
  6. char *countryName[100]; char...

    char *countryName[100];
    char *countryCode[5];
    char *region[200];
    char *incomeGroup[100];

    You either want


    char *countryName;
    char *countryCode;
  7. If you've got particular issues with WxWidgets,...

    If you've got particular issues with WxWidgets, then wxWidgets Discussion Forum - Index page is the place to ask.
  8. Replies
    10
    Views
    313

    Like this. printf("User 1\n"); printf("What...

    Like this.


    printf("User 1\n");
    printf("What is your score for the cost of a PS4?");
    scanf("%d",&rateCost);


    At least try and post something that compiles next time.
  9. Replies
    10
    Views
    313

    A development process...

    A development process

    You need to learn to break the problem down into achievable steps. Just staring at the list of things to do and just hoping to visualise the entire answer in one keyboard...
  10. Replies
    10
    Views
    313

    You need to show us what you can manage for...

    You need to show us what you can manage for yourself, and then we help you get past whatever block there is in your knowledge.

    Just dumping your assignment doesn't work.
  11. > Is there any way I could have grouped the...

    > Is there any way I could have grouped the letter int variable,
    Yeah, they're called arrays.



    int digits[16];

    /*
    i = ccnum % 10;
    j = ccnum % 1000 / 100;
  12. packet.append(0xBF) packet.append(0xAB) ...

    packet.append(0xBF)
    packet.append(0xAB)
    packet.append(0xCD)
    packet.append(0xEF)
    Well since these aren't printable characters, what were you expecting?

    Instead of

    ...
  13. Except things like threads, concurrency and...

    Except things like threads, concurrency and synchronisation are more like platform issues rather than compiler issues.

    > uint pos = ++(zque->que);
    If you let two threads pointing at the same zque...
  14. Why aren't you using actual pthread primitives?

    Why aren't you using actual pthread primitives?
  15. Thread: Struct.

    by Salem
    Replies
    11
    Views
    166

    Circular linked lists are a bit of a pain,...

    Circular linked lists are a bit of a pain, especially if you care about element order.
    Linked list - Wikipedia

    A simple example.


    #include<stdio.h>
    #include<stdlib.h>
    #include<string.h>
  16. Replies
    17
    Views
    328

    I guess it would be something like this ...

    I guess it would be something like this


    if (opt == 'a') {
    for (i = 0; i < num; i = i + 1) { // reading 5 values from user and storing it in array
    printf(" Enter the value...
  17. Replies
    17
    Views
    328

    No, there are 10 different places where you make...

    No, there are 10 different places where you make the same mistake.


    $ gcc -Wall -Wextra -c main.c
    main.c: In function ‘As5GradeB’:
    main.c:18:11: warning: format ‘%d’ expects argument of type...
  18. Replies
    17
    Views
    328

    > scanf("%d", &a); All your references to your...

    > scanf("%d", &a);
    All your references to your array should have a subscript.
    As in
    scanf("%d", &a[i]);
  19. Replies
    2
    Views
    144

    > root@ And create yourself a proper user...

    > root@
    And create yourself a proper user account for your day to day activities.
  20. Replies
    6
    Views
    190

    You have to think about what this leaves on the...

    You have to think about what this leaves on the input stream
    > scanf("%d", &choice);

    To understand what this actually means
    > scanf("%[^\n]%*c", uname);

    The \n that the %d conversion leaves...
  21. Replies
    6
    Views
    190

    Pretty much. printf("\033[2J"); // should also...

    Pretty much.

    printf("\033[2J"); // should also clear the screen.
    printf("\033[H"); // move cursor home

    ANSI escape code - Wikipedia
  22. Replies
    4
    Views
    153

    So in a very basic sense, you could do this. ...

    So in a very basic sense, you could do this.


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

    void input( char ***ptr ) {
    *ptr = malloc( sizeof(**ptr) );
    (*ptr)[0] = malloc(...
  23. Replies
    4
    Views
    153

    What sort of help do you need? Is it...

    What sort of help do you need?

    Is it everything, or just the finer detail of dealing with three stars and malloc?

    Can you for example complete the assignment if you started with
    char...
  24. > However the danger with allocating on the stack...

    > However the danger with allocating on the stack is that of stack smashing, a very big danger indeed.
    No less dangerous than heap smashing, but certainly more immediately obvious.
    If you write bad...
  25. Replies
    6
    Views
    225

    1. Better indentation - Indentation style -...

    1. Better indentation - Indentation style - Wikipedia
    Pick a style and stick to it.
    In particular, do not mix spaces and tabs. Your code editor might make a decent job of it, but as soon as you...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4