Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.27 seconds.

  1. Replies
    2
    Views
    142

    You just did.

    You just did.
  2. Replies
    3
    Views
    87

    Well the OS has to physically map the 400MB of...

    Well the OS has to physically map the 400MB of memory you basically use as write-only memory.

    That's a lot of memory to write once, read once from.
  3. Cross-posted here -> Need guidance on how to make...

    Cross-posted here -> Need guidance on how to make a rectangle - C++ Forum
  4. I'm pretty sure all that nonsense results in...

    I'm pretty sure all that nonsense results in undefined behaviour.
  5. Replies
    3
    Views
    146

    Do something like rand() % 100

    Do something like
    rand() % 100
  6. Before the exec call, do this ...

    Before the exec call, do this


    dup2(pfd[READ], STDIN_FILENO);

    This will join the appropriate end of the pipe to the stdin of the child process.
  7. Replies
    2
    Views
    127

    Duplicate Function not returning date string...

    Duplicate
    Function not returning date string
  8. Replies
    14
    Views
    323

    Your first cut of C code should look like this....

    Your first cut of C code should look like this.
    It's basically all the bullet points of your assignment written as comments.


    int main ( ) {
    // a) Allow the user to enter their own...
  9. Replies
    3
    Views
    154

    Well you could step through the code with a...

    Well you could step through the code with a debugger.

    Like I did.


    $ gcc -g foo.c
    $ gdb -q ./a.out
    Reading symbols from ./a.out...done.
    (gdb) b substr
    Breakpoint 1 at 0x4008b9: file foo.c,...
  10. Replies
    3
    Views
    154

    So what's an example of a test case that you...

    So what's an example of a test case that you think should pass, but actually fails?
  11. Replies
    5
    Views
    319

    Can you please use "copy-as-text" in your IDE, or...

    Can you please use "copy-as-text" in your IDE, or "paste-as-text" in your browser.
    I'm fed up of fixing the colour eyesore that you post by default.

    Also, malloc and mysql_real_escape_string...
  12. So what's your question? I could tell you to...

    So what's your question?

    I could tell you to not use such large arrays, and to allocate it dynamically.

    I could tell you to read the valgrind message, and use the --max-stackframe like it tells...
  13. > ==15108== at 0x419BD5: loadMap (map.c:356)...

    > ==15108== at 0x419BD5: loadMap (map.c:356)
    I suppose it might help to know which actual line of code this corresponds to your snippet.

    > int numbers[ROOMS];
    Is ROOMS some stupid large...
  14. Replies
    14
    Views
    323

    Well your generate_random and main are all mushed...

    Well your generate_random and main are all mushed together.

    It's


    void generate_random ( int *a, int n ) {
    // some code goes here
    }

    int main ( ) {
  15. > Firstly is this code safe? No. - you don't...

    > Firstly is this code safe?
    No.
    - you don't check GetModuleFileName for success (I really hope this code goes nowhere near XP, which broke GetModuleFileName)
    - len is unnecessarily an int - make...
  16. Are you sure that your Fortran buffer is aligned...

    Are you sure that your Fortran buffer is aligned correctly for accessing ints and doubles?

    Try
    double *vars = (double *)((char*)cbData + 8);
  17. Replies
    22
    Views
    329

    It would help if you provided some actual inputs...

    It would help if you provided some actual inputs we could test with, along with your interpretation of what the correct answer should be.

    And your analysis in post #6 is essentially correct, your...
  18. Replies
    22
    Views
    329

    for (Ctr1 = 0; Ctr1 < TotalPossibleLines; Ctr1++)...

    for (Ctr1 = 0; Ctr1 < TotalPossibleLines; Ctr1++)
    {
    for (Ctr2 = Ctr1 + 1; Ctr2 < TotalPossibleLines; Ctr2++)
    {
    if (SlopeOfLine[Ctr1] == SlopeOfLine[Ctr2])
    ...
  19. Thread: Slow forum?

    by Salem
    Replies
    11
    Views
    458

    This is what's going on. There are currently...

    This is what's going on.

    There are currently 7379 users online. 3 members and 7376 guests
    Most users ever online was 10,455, 1 Day Ago at 08:54 AM.

    The normal load is around 300 or so.

    The...
  20. Replies
    2
    Views
    97

    Well it rather depends what other file reading...

    Well it rather depends what other file reading functions have already happened.

    Normally, I would suggest just using fgets() to read each line, then use sscanf (or any other string processing...
  21. What's your actual homework say? If you need...

    What's your actual homework say?

    If you need to show your calculation of all the intermediate sums to your tutor / print them out, then an int array is fine.

    But if all you're after is a final...
  22. > //insert the sum of the double of...

    > //insert the sum of the double of eOther1 into its array, deOther1
    > deOther1[t] = deOther1Sum;
    1. You don't need to do this.
    2. If you really wanted to do this, you would make it...
  23. First of all, your indentation needs work. ...

    First of all, your indentation needs work.


    #include <iostream>
    #include <vector>
    #include <fstream>
    #include <iterator>
    #include <algorithm>
    using namespace std;
  24. Oh and don't start multiple threads with...

    Oh and don't start multiple threads with basically the same question.
    https://cboard.cprogramming.com/c-programming/178095-looping-my-program.html#post1289865
  25. Something like do { printf("What...

    Something like


    do {
    printf("What program would you like to open, %s?\n", name);
    scanf("%s", input);

    // your code

    printf("Is there another program you would like to...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4