CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Roman Numerals

  1. #1
    Join Date
    May 2004
    Posts
    249

    Roman Numerals

    can anyone help me code a program that would change all the integers entered by the user into Roman Numeral.

  2. #2
    Ejaz's Avatar
    Ejaz is offline Elite Member Power Poster
    Join Date
    Jul 2002
    Location
    Lahore, Pakistan
    Posts
    4,211

  3. #3
    Join Date
    May 2004
    Posts
    249

    Re: Roman Numerals

    is there any other way to do it without using classes.. i mean using the features available in the C++ platform??

  4. #4
    Ejaz's Avatar
    Ejaz is offline Elite Member Power Poster
    Join Date
    Jul 2002
    Location
    Lahore, Pakistan
    Posts
    4,211

    Re: Roman Numerals

    Classes are part of C++, aren't they? The author (Ajay Vijay) has provided the source with the article as well, you can trim it according to your need and get out of it what you want.

  5. #5
    Join Date
    May 2004
    Posts
    249

    Re: Roman Numerals

    i know that but the thing is that i wanted a simple code with mayb n if.........else statements... the code i m requesting will help me in some way. if i had to use classes i would have done it somehow or the other

  6. #6
    Join Date
    Mar 2005
    Location
    New Zealand
    Posts
    36

    Re: Roman Numerals

    I don't see what the problem is, Ejaz gave you exactly what you asked for.
    The ConvertToRoman function is almost entirely C style code, it only uses CString to reverse the string and return the result.

  7. #7
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Roman Numerals

    Quote Originally Posted by rockx
    i know that but the thing is that i wanted a simple code with mayb n if.........else statements... the code i m requesting will help me in some way. if i had to use classes i would have done it somehow or the other
    Just take the function from the class and put it in your code. If you don't want MFC replace CString with STL's string.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured