1.

Solve : String Manipulation using C++?

Answer»

I wanted to play around with using string manipulation to divide very large numbers.

I will have a very simple input of the dividend and divisor and my program will print out the quotient and remainder. I will also be giving inputs with leading zeros but I will not include them in my output.

How would I accomplish this using string manipulation?

Thanks for your help. if its for WORK, why are you using C++
if its for homework, where are your code?
I am playing around with it I think I have it solved there are a few kinks I am working on. And what wrong with C++ it is widely used.Quote from: Circuit_Girl on August 30, 2010, 01:01:59 AM

And what wrong with C++ it is widely used.
Nothing is wrong. You can do whatever you want.
But i don't agree with C++ being widely used. It might be widely used back in the hey days, but nowadays, i don't see any use of C++/C , except for
1) if you are writing device DRIVERS where you have to interact with OS at low level
2) if you need the pure speed , such as if you are making a graphics game or something
3) maintaining legacy code written long time ago.

I will tell you what's more likely to be used than C++. Languages like PHP/Perl/Python/Ruby etc. Nowadays, its mostly about the web. You don't often see people using C++ (not that it cannot be done) to rack up a web site application. For system administrators, you don't see many of them writing scripts using C++. (this is not to say they can't produce their own tools using C++)

Besides this, using interpreted languages has its advantages, like quicker development time (you don't to compile, link etc), and they are almost nothing interpreted languages can't do that C++ can. You don't have to take care memory management, and pointers as well etc.



C++'s implementation of OOP is the biggest joke in the history of programming, too. It has one of the most complicated and context sensitive grammars.

Whatever it boils down to essentially C++ is just like C with a few extra macros for classes and stuff. (after all, the original C++ compilers compiled to C code which was compiled by a normal C interpreter.).

There are some "programmers" who seem to think that if you don't know C++, then your a "script kiddie" which is nonsense. As Ghostdog NOTES, if you can do in 5 minutes what takes 5 days to do in C++ then the only reason to do it in C++ would be due to programmer hubris.

C and C++ have nothing called "string manipulation". as far as C and C++ are concerned, you have arrays of characters, and a few functions that work with them as if they are strings. There are classes that can be used but they have terribly designed interfaces and method names that were probably selected in 1970 or something.

And don't get me started on name decoration....


In either case, I'm not sure if C++ has it (I believe it does) but I'm quite certain that python and perl have it (and if they don't I'm sure it can be found in a MODULE or on CPAN), and all the .NET languages have access to it through the framework, but there are "BigInteger" and "BigDecimal" classes that can be used in nearly any language, and they support all the operations, not just division.

Lastly: Even if C++ was widely used, that's hardly a good reason to use it yourself.

@BC, yes Perl/Python (others) do have libraries that deal with BigDecimals. etc. Its all there in the repositories
I am relearning c++ and going to start learning c#. I want to expand my knowledge and write some simple applications and only know how to do it in this language. As far as web programming, I agree PHP and Per kick *censored*. But I do not know how to program windows applications using these languages and I am unfamiliar with python and ruby, but I will learn, eventually.Quote from: Circuit_Girl on September 01, 2010, 12:01:45 PM
I am relearning c++ and going to start learning c#. I want to expand my knowledge and write some simple applications and only know how to do it in this language. As far as web programming, I agree PHP and Per kick *censored*. But I do not know how to program windows applications using these languages and I am unfamiliar with python and ruby, but I will learn, eventually.
PHP/Perl/Python/Ruby etc all have their own GUI packages. Also, libraries are created for interfacing with GTK or QT. So yes, you are able to create GUI applications with them.


Discussion

No Comment Found