Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.31 seconds.

  1. Cross-posted here -> Need guidance on how to make...

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

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

    Do something like rand() % 100

    Do something like
    rand() % 100
  4. 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.
  5. Replies
    2
    Views
    121

    Duplicate Function not returning date string...

    Duplicate
    Function not returning date string
  6. Replies
    14
    Views
    310

    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...
  7. Replies
    3
    Views
    151

    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,...
  8. Replies
    3
    Views
    151

    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?
  9. Replies
    5
    Views
    318

    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...
  10. 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...
  11. > ==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...
  12. Replies
    14
    Views
    310

    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 ( ) {
  13. > 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...
  14. 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);
  15. Replies
    22
    Views
    325

    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...
  16. Replies
    22
    Views
    325

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

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

    by Salem
    Replies
    8
    Views
    410

    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...
  18. Replies
    2
    Views
    96

    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...
  19. 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...
  20. > //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...
  21. 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;
  22. 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
  23. 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...
  24. Cross-posted and answered. Need help with my...

    Cross-posted and answered.
    Need help with my Camera Class! Please!! - C++ Forum
  25. Replies
    3
    Views
    129

    Normally, I would be passing the -c option to cc...

    Normally, I would be passing the -c option to cc as well, if compiling files to put into libraries.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4