Search:

Type: Posts; User: memcpy

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Thread: itoa

    by memcpy
    Replies
    5
    Views
    1,122

    Nope, itoa is not only non-standard but it...

    Nope, itoa is not only non-standard but it doesn't convert a #define into a string.

    Try using stringification.
  2. If you're going to try and get someone to do this...

    If you're going to try and get someone to do this (presumably for free?) for you, you shouldn't attack them with a giant wall of text. Break it up and/or add a TL;DR at the end.
  3. Thread: sandbox

    by memcpy
    Replies
    4
    Views
    1,479

    The OP is obviously talking about a sandbox game...

    The OP is obviously talking about a sandbox game (e.g. Minecraft/Gmod) and not talking about computer security. Don't post useless definitions.
  4. Replies
    15
    Views
    2,282

    Am I missing something or is this: #include...

    Am I missing something or is this:


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

    int main (void)
    {
    char input[128];
  5. Replies
    6
    Views
    2,061

    > This is the assembly instruction flow for the...

    > This is the assembly instruction flow for the given program. You can see the execution flow.
    That's the assembly output for your compiler. Undefined Behavior can produce different results...
  6. Look at the comments and fix: #include...

    Look at the comments and fix:



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

    int main(void) {

    const int TOTAL_TILES = 98; /* change this to a #define */
  7. Replies
    8
    Views
    1,317

    Since you're having trouble with this, here's...

    Since you're having trouble with this, here's some "pseudo"code that might work:



    for (i = 0; i < 15; i++) {
    xind = rand() % ROWS;
    yind = rand() % COLUMNS;

    if...
  8. scanf("%i", &grade); grade = getchar();...

    scanf("%i", &grade);
    grade = getchar();
    if ( grade >= 90){
    /* etc.. */


    You're overwriting the actual grade with a newline character every time. Instead, use:
  9. Replies
    8
    Views
    1,317

    > First, what do you mean Your...

    > First, what do you mean
    Your indentation/formatting on the forum is terrible. There's a button that removes all preexisting formatting when you post.

    > Do you recommend I use cin ques,...
  10. Replies
    8
    Views
    1,317

    You should be using #defines instead of const...

    You should be using #defines instead of const ints for constant values
    Your indentation and formatting are terrible.
    Don't use system("pause") because it's not portable.
    If you want an array of...
  11. Replies
    8
    Views
    1,952

    > That hurts.If i was the compiler i guess i...

    > That hurts.If i was the compiler i guess i would cry.
    hahahaha xD

    But you should seriously check out this link.
  12. Replies
    13
    Views
    4,473

    This is good advice, but remember, it doesn't...

    This is good advice, but remember, it doesn't have to be the same thing every time. Sometimes taking breaks from projects is very helpful when you're trying to solve bugs or add code.


    ...
  13. Replies
    6
    Views
    1,313

    "rightTriAbscissa" isn't a pointer, it should be:...

    "rightTriAbscissa" isn't a pointer, it should be:



    int *leftTriAbscissa, *rightTriAbscissa;
  14. Replies
    13
    Views
    4,473

    If you're trying to complete a program and don't...

    If you're trying to complete a program and don't understand, another thing you could try is to search for other peoples' code that does the same thing. You can then modify/study that code to learn...
  15. Replies
    5
    Views
    1,324

    There's no need to have five different arrays...

    There's no need to have five different arrays with (at least) five different elements just to store one value in each array. And, checking these arrays can be problematic:



    /* let's say that x1...
  16. Can't you just check the IPs...?

    Can't you just check the IPs...?
  17. Can you use write()/send() to STDOUT_FILENO?

    Can you use write()/send() to STDOUT_FILENO?
  18. That's not a replacement for gets(). Did you read...

    That's not a replacement for gets(). Did you read the code before you c/p'd?

    You should use


    char buffer[100];
    fgets(buffer, 100, stdin);
  19. Replies
    3
    Views
    1,387

    It works when you put brackets on the if/else: ...

    It works when you put brackets on the if/else:


    if (x == 0) {
    assert(x<100);
    } else {
    printf("No assert call\n");
    }
  20. Replies
    10
    Views
    7,169

    You know this is a C programming board: and...

    You know this is a C programming board:


    and yet you've still posted Java:
  21. Replies
    2
    Views
    1,010

    Your parentheses are wrong, it should be: ...

    Your parentheses are wrong, it should be:

    ((abcptr)a)->y

    Also, you should avoid using globals and using typedefs to disguise pointers needlessly.
  22. Replies
    2
    Views
    1,623

    You should use a "greedy" algorithm...

    You should use a "greedy" algorithm.
  23. Replies
    21
    Views
    21,488

    You should run your program through a memory...

    You should run your program through a memory detector such as Valgrind and input several different ISBNs, because this loop:


    for(i = 0; i < th2; i++)
    sum = sum + isbn[i]*(i+1);
    ...
  24. Replies
    5
    Views
    1,060

    int main() { file_stream_declaration(); ...

    int main()
    {
    file_stream_declaration();

    char[15] characters_written = "characters";
    fputs(characters_written, fopen);

    return 0;

    file_stream_declaration()
  25. Replies
    5
    Views
    1,519

    You could probably do this with a counting sort...

    You could probably do this with a counting sort as expressed by this "pseudo"code:



    for (i = 0; i < len; i++)
    if (string[i] == '0')
    num_0++;

    for (i = 0; i < num_0; i++)
    ...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4