Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,233 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,804 people online right now. Registration is fast and FREE... Join Now!




Operation on Binary number

 
Reply to this topicStart new topic

Operation on Binary number, Need source code for elementar operation (+-*/)

roby4eldiablo
14 Mar, 2007 - 01:06 PM
Post #1

New D.I.C Head
*

Joined: 14 Mar, 2007
Posts: 2


My Contributions
Hi all, i'm making a client-server concurrent in C for a homework.
the client send me 2 binary number and an operator.
I'll must send him the result and if there's overflow, underflow.

i have made all the initial part of setting the server, children pool and so on.
someone can tell me where i can find the C code for elementar operation on binary number?
or someone can post the code here please?
i receive 2 binary number, each one is on 1 byte.
thanks in advance.
User is offlineProfile CardPM
+Quote Post

msg555
RE: Operation On Binary Number
14 Mar, 2007 - 01:28 PM
Post #2

D.I.C Head
Group Icon

Joined: 4 May, 2006
Posts: 136



Thanked: 2 times
Dream Kudos: 25
My Contributions
Are your binary numbers stored as strings?
User is offlineProfile CardPM
+Quote Post

roby4eldiablo
RE: Operation On Binary Number
14 Mar, 2007 - 03:06 PM
Post #3

New D.I.C Head
*

Joined: 14 Mar, 2007
Posts: 2


My Contributions
i store them into socket buffer (it's a string) and later i sscanf the buf and take out the numbers.

the client give me the operator (+-*/) and the 2 numbers,
i think of making a switch analising the operator and make the opportune operation.

if someone can give me the source of binary operation in C i'm so happy.
because this homework isn't little, and this part is only a little part. thanks in advance.

This post has been edited by roby4eldiablo: 14 Mar, 2007 - 03:57 PM
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 03:34PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month