Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Base 4 math

Name: Anonymous 2009-04-05 23:11

I need to create a custom data type that will only hold numbers in base 4 (unsigned) that will roll over properly and restricted to a number of bits such that if 0 is interpreted as 'A' (0 = 'A', 00 = "AA", 000 = "AAA")and the number it holds is 0 it will print out 'A'
I will need to know how to edit it so that a slightly different data type will print out "AA" exc...

how do i do this in C?

Name: Anonymous 2009-04-05 23:15

Pay an Indian

Name: Anonymous 2009-04-05 23:16

struct mytype { int foob : 4 };

Name: Anonymous 2009-04-05 23:17

DON'T HELP HIM!!!!

Name: Anonymous 2009-04-05 23:25

>>1
You don't.  Use Croma Haskell.NET

>>3
int foob : 2 perhaps.

Name: Anonymous 2009-04-05 23:30

>>5
that will get the first 0->A
how do i get 00->AA?

Name: Anonymous 2009-04-05 23:33

>>6
Use Croma Haskell.NET

Name: Anonymous 2009-04-05 23:33

How is this a custom data type?  An integer is an integer.

Name: Anonymous 2009-04-05 23:34

>>6
Clearer problem description please, you worded it like shit. Quote verbatim from the assignment handout would be ideal.

Name: Anonymous 2009-04-06 10:27

>>8
LOOK, GOD DAMN IT, LOOK AT THIS, THIS IS AN INT, BUT ALSO A CUSTOM DATA TYPE LOOK
type Anux = Int
OR IF YOU CAN'T COMPREHEND ABSTRACT BULLSHITE LOOK AT THIS
struct anux
{
  int hax;
}

FUCK DOES IT MAKE SENSE NOW ITS AN INT BUT ALSO CUSTOM GODMAINUT.

Name: Anonymous 2009-04-06 10:31

>>1
A number is just a number. The base of the number only affects how it is displayed and inputted. Concentrate on the code for doing this (hint: look at the source code of printf to see how it handles format %x) and just store your number as an int or long or whatever.

Name: Anonymous 2009-04-06 10:43

sure is solving people's homework in here. good job /prog/

Name: Anonymous 2009-04-06 11:10

YHOAUVRE SYIOCUP RTEOADDA Y ?

Don't change these.
Name: Email:
Entire Thread Thread List