Search:

Type: Posts; User: penney

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    2,080

    "The Insidious strncpy - Just an FYI"

    The purpose of the strncpy is supposedly to perform safe copies so as to not exceed the limits of your string sizes. The problem with the strncpy is that if your source string is longer than your...
  2. Replies
    2
    Views
    888

    current is null

    The reason for your error is because you are looping through current while there is a current. Therefore, it will be null after the loop finishes. You need to keep a pointer to the last thing prior...
  3. Replies
    15
    Views
    1,626

    Yes they are equivalent. But why are you casting...

    Yes they are equivalent. But why are you casting anyway without an lvalue? Your variable is already a char * so no need to cast. Why not just do rtp++; and forget the cast. You would only want to...
  4. Replies
    2
    Views
    3,024

    Thank you!

    Thank you!
  5. Replies
    2
    Views
    3,024

    HTTP Post Question

    I wrote some code in VB to send XML to a HTTP server. I am including that code below. I confess that I do not know C# but I have a customer who is asking if we would know how to do what I did in VB...
  6. Thread: string pointers

    by penney
    Replies
    1
    Views
    825

    1st off I don't believe you are doing what you...

    1st off I don't believe you are doing what you intend to be doing with your code. An array' name by itself is a pointer to the first location of the array. Therfore just do this:

    ptrchar1 =...
  7. Thread: help

    by penney
    Replies
    2
    Views
    762

    Use the modulus operator - % and if the result is...

    Use the modulus operator - % and if the result is 0 then it's divisible by 3.

    if( (num % 3)==0 ) /* Num is divisible by 3 */
  8. Replies
    6
    Views
    1,112

    Prior to using a pointer you should make sure...

    Prior to using a pointer you should make sure that it is pointing to something and therefore is not NULL. Therefore, in your SetData routine place the following check:

    if( temp ) /* It's pointing...
  9. Your number array must be declared: int...

    Your number array must be declared: int number[10];

    Then you can check for positive and negatives like:

    if( number[i] >= 0 ) /* Your number is positive */
    /* sum up your pos total here */...
  10. Replies
    3
    Views
    1,312

    I am not sure of what you are trying to do....

    I am not sure of what you are trying to do. However, 1st off *ch = 0; will not set all 5 bytes to 0. I assume you are trying to set all bits in a char to 1 bit by bit. You could of course just assign...
  11. Replies
    2
    Views
    936

    If you had only passed a single pointer to the...

    If you had only passed a single pointer to the routine then the routine would have the address of the memory pointer only. By passing a double pointer you are getting the address of what the pointer...
  12. Replies
    14
    Views
    1,455

    You almost got it but you still did not fulfill...

    You almost got it but you still did not fulfill the assignment by writing a createLine function: Here's a snippet of what I believe the teacher is asking for. Sorry for the late response - took the...
  13. Replies
    4
    Views
    1,457

    To make it work you have a number of options. The...

    To make it work you have a number of options. The easiest route is to declare your input as: char input[N_STRINGS][25]; Now the scanf - You can change it to scanf("%s %s %s %s %s %s...
  14. Replies
    14
    Views
    1,455

    #1 First create a type called POINT. To create...

    #1 First create a type called POINT. To create the POINT copy the LINE structure you show above and change the names etc. You should have int x; and int y; in the POINT structure.

    #2 Declare two...
  15. Replies
    9
    Views
    1,029

    One thing you should do and this is probably...

    One thing you should do and this is probably causing the error. Check your index variable 'c' prior to storing to the x and y arrays and make sure it's between 0 and 99. Like so:

    if( c >=0 && c <=...
  16. Replies
    6
    Views
    1,673

    Thank you Stack Overflow and CodePlug for your...

    Thank you Stack Overflow and CodePlug for your replies. I wasn't so much interested in a "fix" for the problem as much as I was a good explanation of the problem itself. I can easily fix the problem...
  17. Replies
    1
    Views
    1,214

    Looks good. You will then have to create a .c...

    Looks good. You will then have to create a .c file that includes the header and then define a variable as one of those types... EMPDATA person; Which could be defined as an array or a pointer to some...
  18. Replies
    6
    Views
    1,673

    Precision Problem

    Please help me understand what's going on:

    I have the following code and it does not appear to do rounding as I would expect it to:



    double val=323.700000,rval;
    double t=26.975;
    int...
  19. Replies
    0
    Views
    1,457

    suppressing leading zero

    /*
    I am attempting to print out a float without a leading zero if it's a
    */
    float number = .2

    /*
    I thought just by specifying the following that this would take care of this:
    */
    float...
  20. Replies
    4
    Views
    11,412

    The problem is that the enums are already...

    The problem is that the enums are already existing in the other programs and they are a much larger structure than the one I provided. Ideally, I didn't want to have to move anything and would like...
  21. Replies
    4
    Views
    11,412

    My intent is to have one file which is shared...

    My intent is to have one file which is shared across many applications. Ideally, I would like that file to reference the names and values within the enum which are defined in whichever program...
  22. Replies
    4
    Views
    11,412

    extern with enum

    I created an enum in a file as follows:



    enum {
    SOME_VAL=201,
    ANOTHER = 202
    };
  23. Replies
    1
    Views
    1,297

    Thank you very much. I did realize that it throws...

    Thank you very much. I did realize that it throws away the last char unconditionally.

    The whole reason I created the routine was because their were a million fprintf's in the program and I needed...
  24. Replies
    1
    Views
    1,297

    Core Dump with Variable Arguments

    I have written the following code which accepts variable arguments:

    void dprintf(FILE *fp,char *fmt,...)
    {
    char OldMsg[BUFSIZ];
    va_list lArgs;

    if(fmt && *fmt)
    ...
  25. The other thing that you can do is use the...

    The other thing that you can do is use the keyword DISTINCT in your SQL SELECT statement.
Results 1 to 25 of 47
Page 1 of 2 1 2