Search:

Type: Posts; User: cjohnman

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    3,325

    What about spaces at the end?

    Will it cause any problems if the space is after the string like below?

    "23.345 "
  2. Replies
    4
    Views
    3,325

    atof function question

    I thought if atof was used on a string containing spaces it would not work. I have inserted spaces before the string and after. The atof still converts the string to a double. Is that everyone elses...
  3. Replies
    18
    Views
    3,419

    Works Great!!

    As always...

    Thanks Todd!!
  4. Replies
    18
    Views
    3,419

    Does this look about right?

    char hardness[256];
    char *first_nonblank;
    double hardness2;
    /* int num_spaces = 0; */

    strcpy(hardness," 23.345");
    first_nonblank = hardness;

    if...
  5. Replies
    18
    Views
    3,419

    That makes sense - Thanks!!

    I applied that to my code shown below. I need to do some tuning.. not working yet. Anything stick out as problem? The only drawback is I will have to reinitialize the variable prior to each while...
  6. Replies
    18
    Views
    3,419

    Just ran into one problem

    I just realized I need to discard the first space if one exists but if more than one exists do some error handling. So I only want the value if no space exists or if one exists. Other than that break...
  7. Replies
    18
    Views
    3,419

    Laserlight Thanks!

    I plugged your simplified version of Todds code in and it worked great! Thanks for your feedback. If there was more than one space this would work and no worrys about memory leak right?
  8. Replies
    18
    Views
    3,419

    Thanks Tod!!!

    The following works great thanks to Tod's help!



    char hardness[256];
    char *first_nonblank;
    double hardness2;

    strcpy(hardness,"23.345");
    first_nonblank = hardness;
  9. Replies
    18
    Views
    3,419

    Made following changes and now get core dump

    char hardness[256];
    char *first_nonblank;
    double hardness2;

    strcpy(hardness,"23.345");
    first_nonblank = hardness;

    while (*first_nonblank)
    {
    if...
  10. Replies
    18
    Views
    3,419

    Thanks for feedback

    Thanks for pointing out some improvements for my existing code. I will look into making those changes. I plugged the code above in this morning and it works but I am seeing the space in my printf and...
  11. Replies
    18
    Views
    3,419

    Help discarding a space in char array

    I have some embedded sql code that reads data from a sql database and inserts the data into a ingres isql database. That works fine. My problem lies in the code when I use atof to convert a character...
  12. Replies
    16
    Views
    2,789

    Looks like the abf form was at fault

    I found the problem and it ended up being the format of a field on an abf form. I now have a bigger problem on my hand due to dependencies. It is converting a varchar 25 column from the db into...
  13. Replies
    16
    Views
    2,789

    mktime()

    It appears my date is changed by this function call. Do you think its possible this function would change a date from 12-May-2008 to 12-may-2008? I am trying to debug now.



    if (!rt_stat)
    ...
  14. Replies
    16
    Views
    2,789

    Was thinkin that

    Todd thanks for your help. I was thinkin that would work but I have been told to find where the problem originates and correct it there. Are you thinking I should do an update in the 4GL file where...
  15. Replies
    16
    Views
    2,789

    This date is coming from a database

    This date comes from a database column called entry_dt_tm and then the 4gl file trys to reset this date based on certain events. Thats where the problem lies because it just seems to call this...
  16. Replies
    16
    Views
    2,789

    Little more info

    ff_time is a struct:

    [code]
    77 struct tm ff_time;
    78
    79 int rt_stat,tmp_year;
    80 char tmp_mon[4], tmp_date[13],tmp_time[9];
    [\code]

    And the purpose of...
  17. Replies
    16
    Views
    2,789

    Ok so I need to find...

    I will need to find what ff_time.tm_mon = 0,1,2.... means? I am thinking based on your replys I should find in a header file something stating if ff_time.tm_mon = 0
    0 is somehow = jan

    Is this...
  18. Replies
    16
    Views
    2,789

    Advice changing a function please

    I have a function that is changing the first letter in the month to lower case and I want to make a change that stops this from occuring. I believe I found a if statement that is making this change....
  19. Can someone make sense of this memset for me?

    memset((char *) &ordr_mstr,'\0',sizeof(struct ordr_mstr_));
  20. Replies
    5
    Views
    1,480

    Yes I found that special something

    Thanks for your help! What a clumsy mistake.
  21. Replies
    5
    Views
    1,480

    Thanks but why is aa & bb = 2

    Thanks I made the correction below:



    aa = swap2(aa);
    printf("%d is aa now\n", aa);

    bb = swap2(bb);
    printf("%d is bb now\n", aa);
  22. Replies
    5
    Views
    1,480

    Can not find error in this code

    I am trying to compare how different functions work and I do not see whats wrong here. I expect to see 100 and 200 on the printf after the second function call and I get 2...2 no matter what I do...
  23. Replies
    5
    Views
    16,818

    One more question

    If I dont free stanford (which I will always do) what are some of the problems that could occur? Also if I did not check for null and memory was not available what type of problems could arise?...
  24. Replies
    5
    Views
    16,818

    Thank you very much

    That works great and I will check for null as you advised.
  25. Replies
    5
    Views
    16,818

    malloc sizeof struct

    How can I use malloc to create memory instead of assigning the pointer below to an instance of this struct?



    struct fraction {
    int numerator;
    int denominator;
    ...
Results 1 to 25 of 115
Page 1 of 5 1 2 3 4