Search:

Type: Posts; User: gwarf420

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    7,524

    The only thing I've found in scope of the .NET...

    The only thing I've found in scope of the .NET environment is that the KeyPreview property can be turned on to check keypresses before they are delivered to the focused control which limits this to...
  2. Replies
    6
    Views
    7,524

    API or MFC in Managed C++ (.NET)

    A part of one of my projects will require me to override the wndproc() function to catch a user-determined hot-key and right-click from an external application. I've been going through a couple...
  3. Replies
    15
    Views
    9,598

    Yes, but in explaining why char pointers should...

    Yes, but in explaining why char pointers should be declared const it should be natural to address the likely common question that "If I claim a char pointer as constant, it will not allow me to...
  4. Replies
    15
    Views
    9,598

    Why do you assign the address of the array...

    Why do you assign the address of the array instead of just "myArray"? Isn't "myArray" the same as "&myArray[0]"?

    Apparently, you can only use pointer arithmetic if it is done normally: "int...
  5. Replies
    15
    Views
    9,598

    Why does K&R decide to go into the fact that ...

    Why does K&R decide to go into the fact that
    int (*intArray)[10] is a pointer to an int array yet does not show you how this syntax would be used? I've tried declaring it the natural way I would...
  6. Replies
    15
    Views
    9,598

    Thanks laserlight for the explanation. Your...

    Thanks laserlight for the explanation. Your reasoning for using const for string constants was much better than the url wiki source given.

    So is it not possible to initialize a pointer to an int...
  7. Replies
    15
    Views
    9,598

    That slipped by me. I initially was dealing with...

    That slipped by me. I initially was dealing with
    int (*intArray)[4] = { 0, 1, 2, 3 } ; (which I still can't get to work) and decided to change the example to char at the last minute which...
  8. Replies
    7
    Views
    5,796

    *str == str[0] Pointers point to the first...

    *str == str[0]
    Pointers point to the first element of an array. So when you dereferenced str you were assigning 'R' as the first element of the array.

    printf prints all the characters in an...
  9. Replies
    10
    Views
    1,654

    Make the change suggested by Salem and you should...

    Make the change suggested by Salem and you should no longer get the error. If the file doesn't exist it should print "Could not open file" to the screen.
  10. Replies
    10
    Views
    1,654

    Yes. When fopen goes to open the said file, if...

    Yes. When fopen goes to open the said file, if it does not exist, it returns the address of NULL instead of the address of said file (It doesn't exist). You cannot fclose (write and close) a file...
  11. Replies
    10
    Views
    1,654

    The sample code has an if statement that first...

    The sample code has an if statement that first checks to see if the file was able to be opened. The else statement only executes if the file was able to be opened. However, because the fclose...
  12. Replies
    15
    Views
    9,598

    Quick Pointer Question

    I'm trying to solidify the concepts of various pointer types and I've run into a problem.

    I know that I can initialize a pointer array (an array of pointers) with something like this:


    char...
  13. Replies
    26
    Views
    35,051

    I just tried fgets(). Unfortunately, it...

    [QUOTE]
    I just tried fgets(). Unfortunately, it has the same response to finding more input than specified. it just dies.[/QOUTE]

    My bad, I was using a function that tested gets_s() and then...
  14. Replies
    26
    Views
    35,051

    Thanks, I'll make sure to free it and I see that...

    Thanks, I'll make sure to free it and I see that it is not Null terminating the string also.
    I just tried fgets(). Unfortunately, it has the same response to finding more input than specified. it...
  15. Replies
    26
    Views
    35,051

    so, the only check in the line "if (gets_s( buff,...

    so, the only check in the line "if (gets_s( buff, BUFFSIZE ) == NULL )" is to see if there is an absence of input in which the error is caught and handled. But does not check whether or not the...
  16. Replies
    26
    Views
    35,051

    so, the line "if (gets_s( buff, BUFFSIZE ) ==...

    so, the line "if (gets_s( buff, BUFFSIZE ) == NULL )" is not testing the return value of gets_s() but in fact testing to see if the buffer I specified was NULL? I'm sorry but that doesn't make sense...
  17. Replies
    26
    Views
    35,051

    In the secure coding article at...

    In the secure coding article at buildinsecurity.us-cert.gov what is the purpose of the following code if it is only going to bomb out before the exception can be handled?



    if (gets_s(buff,...
  18. Replies
    26
    Views
    35,051

    so, because every modern OS has memory...

    so, because every modern OS has memory protection, using gets() throws a fault and doesn't continue just like gets_s. Why should I go through the trouble of using these supposedly more robust/secure...
  19. Replies
    26
    Views
    35,051

    I see now, it had ISO/IEC 99 as a reference as...

    I see now, it had ISO/IEC 99 as a reference as well simply because it was talking about current standard functions as well as ISO/IEC WDTR 24731 (Secure C Library).

    So the VC++ implementation of...
  20. Replies
    26
    Views
    35,051

    As for ISO definition of gets_s, I got my...

    As for ISO definition of gets_s, I got my information from this site: buildsecurityin.us-cert.gov

    As far as I can tell from the explanation of the gets_s function, explained in the link above, ...
  21. Replies
    26
    Views
    35,051

    gets_s is defined in ISO/IEC 99 maybe that is why...

    gets_s is defined in ISO/IEC 99 maybe that is why it is not in other compilers?

    but for VC++ my code looks like this:


    #include <stdio.h>

    int main ( int argc, char *argv[] )
    {
    char...
  22. Replies
    26
    Views
    35,051

    How to use gets_s

    I don't know why I can't get this function to work, but I've spent all day and all night searching and have found nothing but problems. gets_s(buffer, size) is supposed to be a more direct, more...
Results 1 to 22 of 22