Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.57 seconds; generated 14 minute(s) ago.

  1. You can use strrchr...

    You can use strrchr to find the last '.' in a string.
  2. Replies
    2
    Views
    306

    In your makefile (or some pre-build step), do ...

    In your makefile (or some pre-build step), do


    echo 'const char *version="'$(git describe --abbrev = 4 --always --tags)'";"' > version_info.c


    Then compile and link with that file, with an...
  3. Replies
    23
    Views
    611

    > If the conditional falls through (in other...

    > If the conditional falls through (in other words, the 'else' case), there are instructions to discard the subroutine address from the stack
    > and then jump to a completely different part of the...
  4. Your PrintCard is broken. $ gcc bar.c...

    Your PrintCard is broken.


    $ gcc bar.c
    bar.c: In function ‘PrintCard’:
    bar.c:90:12: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
    tempsuit = deck[0];
    ...
  5. Sure, post your latest code. But make sure you...

    Sure, post your latest code.
    But make sure you use "copy as text" in your IDE and/or "paste as text" in your browser, to stop it looking a mess (as you deleted from your other posts).
  6. Replies
    2
    Views
    291

    > void storeMaze(int N, int M, int matrix[N][M],...

    > void storeMaze(int N, int M, int matrix[N][M], FILE *fp);
    If you can do this,

    then you should be able to do this
    bool findPath(int N, int M, char maze[N][M], int x, int y)

    But I would...
  7. Replies
    23
    Views
    611

    What's the end goal here? a) Actual readable C...

    What's the end goal here?

    a) Actual readable C code you can maintain and enhance in the future.
    b) The ugliest hack that will just get past a C compiler to allow you to put the same functionality...
  8. Replies
    23
    Views
    611

    In C if ( foo != 0 ) { // then code }...

    In C


    if ( foo != 0 ) {
    // then code
    } else {
    // else code
    }
  9. Replies
    23
    Views
    611

    Do you have an instruction set reference? 6800...

    Do you have an instruction set reference?
    6800 instruction set

    BMI - Branch if minus
    if ( my_signed_number < 0 )

    BPL - Branch if plus
    if ( my_signed_number >= 0 )
  10. Replies
    6
    Views
    415

    TBH, I would suggest you start with int...

    TBH, I would suggest you start with


    int coins_array[] = {1,1,2,2,3};
    int N = sizeof(coins_array) / sizeof(coins_array[0]);
    int S = 6, Sol[MAX], IndexUsed[MAX], total;


    It's something you...
  11. Replies
    1
    Views
    266

    Your pseudo code looks fairly reasonable, but...

    Your pseudo code looks fairly reasonable, but your actual code bears almost no resemblance to it (and is just plain wrong in many places).

    Start by pasting the pseudo-code into code.


    int main...
  12. Replies
    27
    Views
    736

    foo.c: In function ‘subtraction’: foo.c:776:20:...

    foo.c: In function ‘subtraction’:
    foo.c:776:20: warning: ‘x1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (x1 == NULL && x2 == NULL) {

    You make a point...
  13. Replies
    27
    Views
    736

    Do you have a short example of the input data...

    Do you have a short example of the input data file?
  14. Replies
    3
    Views
    509

    Tsk Tsk - quoting your own post only to mis-quote...

    Tsk Tsk - quoting your own post only to mis-quote it with the spammy link.
    Nice try.
  15. Replies
    6
    Views
    415

    A couple of thoughts spring to mind. 1. You...

    A couple of thoughts spring to mind.

    1. You have no exit condition for your recursion.
    You keep doing back(step+1); but there is no if(step==?) return; case to tell you that you've either...
  16. You're using the Orwell one and it doesn't work?...

    You're using the Orwell one and it doesn't work?

    I commented out Item (not that it should matter for the purpose of the exercise), and it compiles just fine here



    $ cat menu.h
    #ifndef...
  17. Replies
    27
    Views
    736

    @amohammed63, please use "copy as text" and/or...

    @amohammed63, please use "copy as text" and/or "paste as text" options of your IDE / browser.
    Your posts are unformatted and unreadable with the mix of pastel colours.
  18. Are you talking about the archaic "Bloodshed"...

    Are you talking about the archaic "Bloodshed" Dev-C++ or the somewhat up to date "Orwell" Dev-C++.

    Because the bloodshed one is about 20 years out of date.

    Dev-C++ download | SourceForge.net
  19. Which compiler/IDE are you using?

    Which compiler/IDE are you using?
  20. Replies
    1
    Views
    253

    This isn't a homework on demand site. If you...

    This isn't a homework on demand site.
    If you want help, you need to make an effort first.
  21. > How do I check it before using from multiple...

    > How do I check it before using from multiple pthreads?
    Does it use any global variables?
    Does it use any static variables?
    Does it open any files for writing?
  22. Replies
    8
    Views
    409

    As I said m[i][j] = pow(i+1,j+1); pow()...

    As I said


    m[i][j] = pow(i+1,j+1);


    pow() is in math.h
  23. Replies
    8
    Views
    409

    I thought it was just a 2D array of some number...

    I thought it was just a 2D array of some number of rows initialised with
    x, pow(x,2), pow(x,3)
  24. Replies
    3
    Views
    294

    What you posted makes no sense. i and k are...

    What you posted makes no sense.

    i and k are unused.
    something and xx are undeclared.
    x % x is always 0 to begin with, so its always going to break out of the loop.

    The whole lot just seems to...
  25. Replies
    3
    Views
    294

    Maybe you should state the whole question, not...

    Maybe you should state the whole question, not some paraphrased mis-understanding of it.

    'if' is also a 'test', not a 'some' (whatever that is).
Results 1 to 25 of 494
Page 1 of 20 1 2 3 4