Bigint modification - please help

This is a discussion on Bigint modification - please help within the C++ Programming forums, part of the General Programming Boards category; I am new to C++. I want to learn working with really large values with Bigint. I downloaded the code ...

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    12

    Bigint modification - please help

    I am new to C++. I want to learn working with really large values with Bigint. I downloaded the code
    from C++ BigInt class | Download C++ BigInt class software for free at SourceForge.net.
    I can compile and run it. But I dont have enough knowledge to delete all the demo code from there.
    It runs in 3 seconds flashing some text on the screen and then quits.
    Can someone help me to:
    1) Get rid of all the demo code
    2) Help me add some simple code like:
    "#include "BigInt.h"
    BigInteger a = 65536;
    cout << (a * a * a * a * a * a * a * a);"
    I tried to add it, but compilation fails.
    3) Keep DOS window open instead of quitting. I tried adding system ("pause"); but it would not comile.
    I wouldn't mind spooling it to a text file too.

    I am reading C++ in 21 days to learn this, but I don't have 21 days.
    The code is at C++ BigInt class | Download C++ BigInt class software for free at SourceForge.net. Your help is much appreciated!

  2. #2
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    407
    > 1. Get rid of all the demo code

    If you don't know the code you are looking at it is likely you are in over your head and it might be logical to start with something simpler. If this isn't an acceptable method, then my second suggestion would be to start googling commands you don't understand and see what they do. When you get the google results make sure they are for C++ and not Java or C.

    > 2.

    You already have the gist of it... look at the class in the .h see what you are able to do with it and start programming around it. If you are expecting someone to post a full example of a program for you to copy paste and compile that usually doesn't, and most likely won't happen on this board. A better start to this approach is for you to start writing a program around this class and when things aren't compiling... sit down with a pen and paper and track your variables just like a normal math problem. If you still can't find the answer post the code here (USE CODE TAGS) and people will be alot more likely to help.

    > 3. Keep Dos running
    I used cin.get() back when I was programming with just a command promp output. There are other methods to solving this problem. I'm sure I've seen this answered a hundred times on this board if you just do a search through old posts, you should be able to find an answer that works for you.

    My last suggestion is to do some reasearch on how classes work before you start playing with a downloaded class. Honestly classes were VERY hard for me to pick up when I was first programming (lol that was only 6 months ago when I finally learned them), but they will make a HUGE difference in your programming efficiency, style, variable control, ect.

    P.S. Find a better book... I bought that one when I first started learning and burned it in under a week lol. It is good for teaching from the very beginning, but I honestly found the tutorial at cprogramming.com to be alot more informative and accurate. Welcome to C++. Hope you enjoy the new language ;o).

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,762
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    407
    lol a pro at finding people asking the same question on a different board.

  5. #5
    Registered User
    Join Date
    Sep 2010
    Posts
    12
    Thank you all guys and girls for answering.
    "lol a pro at finding people asking the same question on a different board."
    - I confess, I did it. I was under the impression (wrongly, as it turns out!) that this rule applies to posting the same question in different threads on the same site, but posting on different sites with different experts was fine.
    Why is this unacceptable? The sites have different URLs and owners/users (I think). I dont want to be deemed ungrateful (like when you give out donations and people collecting ask you why do you give so little?), you are the ones giving on your own free will and time and I am the one extending my palm ... I very much appreciate it, but this stipulation seems a bit silly.
    Who can explain this to me? Why posting to different sites is a "no-no".
    Much obliged and thanks for the ideas and making fun of me ;-)
    Last edited by grigorianvlad; 09-16-2010 at 07:11 AM.

  6. #6
    Registered User
    Join Date
    Sep 2010
    Posts
    12
    Lesshardtofind, I am afraid your are right. I was hoping for somebody to quickly fix it for me without even understanding what is does, but then there would be a next piece of code, and again, and again. I cant rely on someone else to do it. I need to learn the basics which takes effort and time. I dont' mind the first, I just don't have the second. Anyway, it seems for now I should have been reading the missing day 0 in "Learn C++ in 21 days". It is called "How to spell C++".
    Anyway, thanks for your candor and thanks for taking the time to answer everybody!
    Last edited by grigorianvlad; 09-16-2010 at 07:15 AM.

  7. #7
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,652
    It's considered rude by many because the people here - and elsewhere - volunteer their time to offer assistance. And as we all should know, time has a value. If someone on one board puts in the effort to provide you with an answer to your question, but it has already been answered elsewhere, then they've wasted their time and effort on you. It just shows a lack of consideration toward others to spam your question between multiple locations.

  8. #8
    Registered User
    Join Date
    Sep 2010
    Posts
    12
    OK, rags_to_riches, that totally makes sense. You know all of these sites. Which one has the most contributors (that's the one I will use)? Thanks for clearing that up.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BigInt
    By lostandconfused in forum C Programming
    Replies: 16
    Last Post: 09-16-2010, 01:30 AM
  2. BigInt division and modulus
    By User Name: in forum C++ Programming
    Replies: 4
    Last Post: 09-11-2010, 04:54 PM
  3. Help with structures and classes
    By jdcollins in forum C++ Programming
    Replies: 1
    Last Post: 11-14-2009, 05:07 PM
  4. Half-Life Goldeneye Modification
    By easter egg in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 04-25-2004, 07:34 PM
  5. bigInt help
    By noob2c in forum C++ Programming
    Replies: 14
    Last Post: 10-10-2003, 09:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21