Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.58 seconds; generated 38 minute(s) ago.

  1. Replies
    3
    Views
    229

    > (a>b)&(2

    > (a>b)&(2<3)The statement is false.
    Do a and b have values, in the usual sense of a variable name has a value.
    In which case, the truth value depends on those values.

    > I have an assignament...
  2. 1. It seems like a good way for hackers to run a...

    1. It seems like a good way for hackers to run a DoS attack on your site by dumping everyone's accounts into a 24 hour purgatory.
    Good luck with that tech support storm.

    2. Your reject rules leak...
  3. Replies
    2
    Views
    123

    Which OS and compiler are you using? I'd guess...

    Which OS and compiler are you using?

    I'd guess Windows, since you mentioned COM1

    CreateFileA function (fileapi.h) - Win32 apps | Microsoft Learn
    Scroll a long way down to "Communications...
  4. Replies
    8
    Views
    263

    void Test(int idx) { uint8_t val1, val2; ...

    void Test(int idx)
    {
    uint8_t val1, val2;

    GetArgumentFromString (functions[idx].arguments[0], &val1); //arguments[0] = "var1"
    GetArgumentFromString...
  5. What exactly are you trying to sum? The whole...

    What exactly are you trying to sum?

    The whole array?
    The first row?
    The first column?

    > int num =(sizeof(b)/sizeof(b[0]));
    This is only going to tell you how many rows your array has (ie, 4)...
  6. I suppose the first question is whether you're...

    I suppose the first question is whether you're learning C or C++.

    You posted on the C++ forum, and your fuzzy filename is a .cpp file.

    But the code is pure C.



    Your inner loop to check...
  7. Thread: Encrypt a number

    by Salem
    Replies
    10
    Views
    313

    > This is how I solved it. I am not sure if this...

    > This is how I solved it. I am not sure if this is how it was supposed to be done.
    Given the information you have, it's fine.

    The final 10 lines of code can be done with one.

    ...
  8. > int *last = &a[n-1]; Make this const int...

    > int *last = &a[n-1];
    Make this
    const int *last = &a[n-1];

    > while(a<=last)
    This should be <, not <=

    > second_largest=*largest;
    > largest=*a;
    You want to update...
  9. Replies
    2
    Views
    116

    Compile with lots of warnings enabled. $ gcc...

    Compile with lots of warnings enabled.


    $ gcc -Wall -Wextra foo.c
    foo.c: In function ‘main’:
    foo.c:4:14: warning: statement with no effect [-Wunused-value]
    4 | int a = 1;2;3;
    | ...
  10. Thread: Handling f-write

    by Salem
    Replies
    21
    Views
    605

    The OP better start posting code to backup their...

    The OP better start posting code to backup their questions.
    Otherwise, it's looking like a repost bot just posting links to random sites.
  11. Replies
    5
    Views
    228

    > but I did not know what the return should be...

    > but I did not know what the return should be look like.
    Well your existing loop throws away nearly all that is read.

    So what do you want to do really?

    At a very basic level, you could store...
  12. Thread: Handling f-write

    by Salem
    Replies
    21
    Views
    605

    > I believe the chance of failure increases with...

    > I believe the chance of failure increases with a larger buffer..
    Explain your dis-belief for the benefit of the rest of us.
  13. Replies
    9
    Views
    289

    > It works but Try again. Your array has 7...

    > It works but
    Try again.
    Your array has 7 elements, but you loop 8 times.

    > but I want to apply that function to calculate the average in each ID and not the total value.
    So perhaps your...
  14. Replies
    9
    Views
    289

    Looked OK, apart from > for (i=0; i

    Looked OK, apart from

    > for (i=0; i<=max; i++)

    It should be <, not <=
  15. Thread: Handling f-write

    by Salem
    Replies
    21
    Views
    605

    Why do you believe a larger buffer size would be...

    Why do you believe a larger buffer size would be a problem?

    If you can't understand all the caveats, maybe you should stick to fgetc and fputc
  16. Replies
    9
    Views
    289

    Are you able to read each line into a buffer...

    Are you able to read each line into a buffer using say fgets?

    So which of these functions have you come across?
    - sscanf
    - strchr
    - strtok

    Any of these can be used to split the line into...
  17. Replies
    7
    Views
    236

    Dribble fest.

    Dribble fest.
  18. Replies
    7
    Views
    236

    It might be your only approach if you're going to...

    It might be your only approach if you're going to eschew creature comforts offered by POSIX
  19. Replies
    4
    Views
    164

    No particular reason, it doesn't make a...

    No particular reason, it doesn't make a difference in this case.
  20. Replies
    4
    Views
    202

    Well that didn't take long.

    Well that didn't take long.
  21. Replies
    6
    Views
    173

    Read the link! Fl_PNG_Image (const char...

    Read the link!

    Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int datasize)
    Constructor that reads a PNG image from memory. More...

    See?
  22. Replies
    4
    Views
    164

    > unsigned int i = *( const unsigned int *) &f ; ...

    > unsigned int i = *( const unsigned int *) &f ;

    & - make a pointer of type float*
    ( const unsigned int *) - make believe that it's a pointer to a const unsigned int.
    * - dereference it to get...
  23. Replies
    6
    Views
    173

    So what does your code look like at the moment? ...

    So what does your code look like at the moment?

    FLTK 1.3.8: Fl_RGB_Image Class Reference
    FLTK 1.3.8: Fl_PNG_Image Class Reference
    These allow you to build an image object from data in memory.
    ...
  24. I thought the whole point of the likes of nuget...

    I thought the whole point of the likes of nuget was to automate all of this.

    Or maybe it's biased towards .net, so anything C++ is an afterthought.

    Anyway, what you need to do is navigate...
  25. > Reallocation fails. Why? Simply put, you...

    > Reallocation fails. Why?
    Simply put, you trashed memory.

    Your 100+ line monster function isn't doing you any favours in terms of s/w understanding.

    > element new_hashtable[new_size];
    If...
Results 1 to 25 of 486
Page 1 of 20 1 2 3 4