Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.20 seconds.

  1. Thread: A .txt file.

    by Salem
    Replies
    5
    Views
    218

    > while( !feof(FileP) ) See here as to why this...

    > while( !feof(FileP) )
    See here as to why this is bad.
    Why it's bad to use feof() to control a loop - Cprogramming.com

    > char FileContent[]=""
    ...
    > // fgets(FileContent, 70, (FILE*) FileP);...
  2. Replies
    1
    Views
    38

    Post your code.

    Post your code.
  3. Replies
    10
    Views
    249

    > So what is myList? A variable - something...

    > So what is myList?
    A variable - something presumably pointing to your circular list.


    > insertIntoList is a new struct?
    Does it look like a struct to you, what with the ( ) and all.
    It's a...
  4. Maybe this will help, since it fixes the...

    Maybe this will help, since it fixes the buffering of stdin which makes it kinda hard to see what's going on.


    #include <stdio.h>
    #include <unistd.h>
    #include <sys/select.h>
    #include...
  5. Replies
    12
    Views
    469

    Good so far, but you want 4 separate variables.

    Good so far, but you want 4 separate variables.
  6. Replies
    10
    Views
    249

    Like this char buff[BUFSIZ]; while ( fgets(...

    Like this


    char buff[BUFSIZ];
    while ( fgets( buff, BUFSIZ, in ) ) {
    incident event; // This is just a temporary copy
    char *token = strtok(buff,";");
    strcpy(event.area, token );
    ...
  7. Replies
    10
    Views
    249

    Yes Yes - specifically, BUFSIZ is declared in...

    Yes

    Yes - specifically, BUFSIZ is declared in stdio.h.

    Yes

    Yes
  8. Replies
    2
    Views
    164

    I prefer modf to num - int(num) as a means to...

    I prefer modf to num - int(num) as a means to getting just the fractional part.
    modf(3) - Linux man page

    Using pow(2,index) to calculate powers of 2 is clunky compared to 1<<index
    Also, the bit...
  9. Replies
    2
    Views
    136

    Well, int displayMap(int, int); void move();...

    Well,

    int displayMap(int, int);
    void move();

    1. Give move a proper prototype.


    int displayMap(col, row)
    void move(opt, mul)
  10. Replies
    10
    Views
    249

    Like this char buff[BUFSIZ]; while ( fgets(...

    Like this


    char buff[BUFSIZ];
    while ( fgets( buff, BUFSIZ, in ) ) {
    incident event;
    char *token = strtok(buff,";");
    strcpy(event.area, token );
    token = strtok(NULL,";");
    ...
  11. Replies
    10
    Views
    249

    Can you post an example data line (or two)?

    Can you post an example data line (or two)?
  12. Replies
    2
    Views
    124

    So what's your actual question? You need to...

    So what's your actual question?

    You need to demonstrate actual effort like
    - code which works, and you don't know what to do next
    - code which doesn't work, and you don't know why

    In short,...
  13. Replies
    1
    Views
    97

    Double posted ->...

    Double posted -> https://cboard.cprogramming.com/cplusplus-programming/179221-i-have-been-struggling-exercise.html#post1296286
  14. Replies
    5
    Views
    173

    Some code and bigger pictures might help....

    Some code and bigger pictures might help.
    They're already fuzzy before you describe what's wrong.
  15. Replies
    5
    Views
    173

    SDL2 antialiasing at DuckDuckGo...

    SDL2 antialiasing at DuckDuckGo
    What you're seeing are the cumulative rounding errors of drawing a diagonal line that is not exactly 45'.
  16. Replies
    21
    Views
    485

    > Why does the teacher want the students to use a...

    > Why does the teacher want the students to use a terminator then?
    Maybe they're trying to teach how strlen() works.
    Maybe they're trying to convey one of several methods of solving the same...
  17. Replies
    8
    Views
    301

    > I guess this worked as a solution for now, If...

    > I guess this worked as a solution for now,
    If you call using 16GB of memory 'a solution'.



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


    int FindDevisors(int n)
  18. Replies
    8
    Views
    301

    > 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.
  19. Replies
    8
    Views
    301

    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...
  20. Replies
    12
    Views
    469

    > 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...
  21. Replies
    21
    Views
    485

    > 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.
  22. Replies
    6
    Views
    189

    > 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],...
  23. char *countryName[100]; char...

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

    You either want


    char *countryName;
    char *countryCode;
  24. 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.
  25. Replies
    12
    Views
    469

    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.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4