Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!asuvax!noao!ncar!gatech!prism!ar12 From: ar12@prism.gatech.EDU (REGISTER,ANDREW H) Newsgroups: comp.lang.c++ Subject: Want to make sign_mag and long sign_mag class, can I? Summary: long modifies a class? Message-ID: <25138@hydra.gatech.EDU> Date: 28 Mar 91 14:16:20 GMT References: <1320@unet.UUCP> <1000001@hpcc01.HP.COM> Organization: Georgia Institute of Technology Lines: 24 I want to build a class to do signed-magnitude arithmetic. (Yes I know I could do this with int and long int.) I want to make a class called sign_mag that would be a 16 bit sign-magnitude number. Then I also want another class that would be a 32 bit sign-magnitude number. I would like to be able to specify this like: sign_mag A16BitSM; long sign_mag A32BitSM; I cannot figure out if this is even possible much less how to do it. I also want to override -, +, *, /, to work with both classes and get the proper type casting. (sign_mag is converted to long sign_mag before being added to a long sign_mag) Any help or pointers in the right direction will be appreciated! Toodles Andy -- Andy Register Internet: ar12@prism.gatech.edu Bitnet: aregiste@gtri01.bitnet -- Sometimes the Bears Win, Sometimes the Bulls Win -- -------- But the Pigs *Always* Lose -------- (author unknown)