David W's Profile User Rating: ***--

Reputation: 275 Architect
Active Posts:
1,781 (0.84 per day)
20-September 08
Profile Views:
Last Active:
User is offline Private

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Who Cares
Your Car:
Dream Kudos:

Latest Visitors

Icon   David W is off-line ...

Posts I've Made

  1. In Topic: Reading numbers from two files

    Posted 15 Jun 2014

    Merging two pre-sorted files is more intricate than merging two pre-sorted arrays.

    If you do a search on the web you may find some (file) examples to guide you.

    Try Google of keywords like: merge two sorted files

    I think there is at least one simple example here at DIC also.

    I found this that looks ok but not as simple as it could be ...

    example of merge sorted files

    Do not forget to handle all the cases ... including the case of either file being empty. (You may assume both files are pre-validated to contain valid pre-sorted data.)
  2. In Topic: Converting string to long, and string to double

    Posted 15 Jun 2014

    View PostCTphpnwb, on 15 June 2014 - 10:18 PM, said:

    I was thinking that since stol was used in the OP then it was available and so C++11 is within the scope of this thread. ;)

    Good point :)

    My demo's were meant mainly ... (as I believe were also Jim's main thrust ... ) to indicate *the ease of parsing a line of test using (mostly) stringstream*
  3. In Topic: Converting string to long, and string to double

    Posted 15 Jun 2014


    Secondly many students will use these features blindly, and will be totally lost when their programs don't properly compile for their instructors because the instructor doesn't use a C++11 compiler. Using these new features wisely is the key.

    So students ... if your prof's are checking your code with pre-C++ 11 compilers ...

    please be advised ...

    if you play with the new C++ 11 features ...

    it's probably best to only submit code that compiles ok with a pre-C++ 11 compiler :)
  4. In Topic: Converting string to long, and string to double

    Posted 15 Jun 2014

    But Jim,

    you can not logically ... at the same time ...

    promote the use of C++ compilers (before C++ 11) to keep things readily compiled by students who still use pre C++11

    and then offer C+11 as a rebuttal :)
    (as per your statements that C++ 11 allows files to be opened with C++ string ... and using the other functions specific to C++ 11)

    Your other arguments are understood, but I think ...

    'no big deal' ...

    in this specific example.
  5. In Topic: Converting string to long, and string to double

    Posted 15 Jun 2014

    Hi Jim,

    I think you missed my point ... (about using stringstream every-where ... and then using the below special handling for the date string only.)

    C strings are not always 'crappy' :)

    Please note that C++ file handling still needs a C string (or text) to be passed in to open a file.

    Here ... the code, using a C string buf is 'easy' and 'clear' and 'simple' ... (and more logical-perhaps?)

    So ... no need then, to disparage the use of C string and atoi to handle that special case.

My Information

Member Title:
DIC supporter
67 years old
June 29, 1947
Toronto Ontario Canada
The events that lead up to the soon return of Yeshua (Jesus) ... and being ready
Full Name:
David Wayne Zavitz
Programming Languages:
6502 Assembly
HLA (High Level Assembly)


Page 1 of 1
  1. Photo

    Invincible-99 Icon

    29 Jun 2012 - 06:10
    Oh, sorry!
    That link doesn't work.
  2. Photo

    Invincible-99 Icon

    29 Jun 2012 - 06:06
  3. Photo

    Anarion Icon

    24 Jun 2012 - 13:44
    Regards to you, awesome friend! ;)
  4. Photo

    v0rtex Icon

    07 Jun 2012 - 03:04
    Thanks for the link! Why would u advise I look at HLA?
  5. Photo

    caleb123 Icon

    22 Jun 2010 - 19:37
    Would you like to be my website designing buddy? If you do, you can email me at cheryman22@yahoo.com
    You and I can give each other tips and answer question to make us both better at designing websites.
  6. Photo

    skyhawk133 Icon

    08 Jun 2010 - 09:43
    Great to have you David! Thanks for the kind comment.
  7. Photo

    xxxpriya Icon

    20 Feb 2010 - 21:25
    thanx a lot david
Page 1 of 1