Search:

Type: Posts; User: groberts1980

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    1,522

    scanf was the problem, thank you. Using fgets is...

    scanf was the problem, thank you. Using fgets is now getting the whole line.
  2. Replies
    4
    Views
    1,522

    Converting a String to Uppercase

    I've searched the forums, and implemented a lot of answers found here, but none of them seem to work entirely.

    Here is the code in question:


    #include <stdio.h>
    #include <strings.h>...
  3. I emailed him, this was his response: "The...

    I emailed him, this was his response:

    "The page size needs to be hardcoded. I'll explain why in lecture next time. For now, just write a 2-line program to print the value and plug that value...
  4. #include #include #include...

    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>

    int main(int argc, char ** argv)
    {
    int getpagesize(void);
    int columns;

    columns = getpagesize();
  5. Here is the revelent part of the assignment. This...

    Here is the revelent part of the assignment. This was copied and pasted directly from a PDF file that we were given. I don't know what else to say. This is what the professor gave us. Keep in mind...
  6. Can I not just declare the array as global? Can...

    Can I not just declare the array as global? Can we not just talk about the syntax to do that? Its a simple question. I'm not using malloc(), nor am I storing the array in a file. Saying the professor...
  7. Okay, I typed that into my program. Doesn't seem...

    Okay, I typed that into my program. Doesn't seem to help :-)
  8. I'm afraid I do need to store it all at once. The...

    I'm afraid I do need to store it all at once. The program is for an Operating Systems course, and the current subject matter is virtual memory. We are supposed to create this 2D array, set each value...
  9. How To Declare and Dynamically Size a Global 2D Array?

    I need to use a 2D array of chars. The first field (rows) is set at 20480. The second field (columns) needs to be set at runtime (4096 being one possible value). The size of the 2D array will be too...
  10. So, it will compile. And it will run. With...

    So, it will compile. And it will run. With unintended consequences, but it'll run. How is that "not allowed"? C does not do boundry checking. Technically, you CAN do that. You can read and write a[...
  11. How is new more dummy resistant than malloc? I...

    How is new more dummy resistant than malloc? I realize my example has nothing to do with malloc/new, I just meant "safety" in terms of shooting yourself in the foot. And my example shows that you can...
  12. I guess in the sense that this is legal in C: ...

    I guess in the sense that this is legal in C:

    main() {

    int a[5];

    *( a + 7 ) = 1;
    a[ 9 ] = 5;

    }
  13. malloc & free in C vs. new & delete in C++

    How would you compare C’s malloc and free functions with C++’s new and delete operators in terms of safety?
Results 1 to 13 of 13