Thread: trying to convert system bytes into bits and nibbles.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    trying to convert system bytes into bits and nibbles.

    i use vim and we have to create this basically creating is as a subroutine
    Code:
    /*
          2 File: Lab3-5.c
          3 Course: 
          4 Author: 
          5 Date: Monday January 23, 2006
          6  */
          7
          8 #include <stdio.h>
          9 void datatypes()
         10 {
         11     
         12     
         13   
         14
         15     fprintf(stdout, "Type float on Munro has a size of %u bytes \n",sizeof(float));
         16     fprintf(stdout, "Type double on Munro has a size of %u bytes.\n",sizeof(double));
         17     fprintf(stdout, "Type long double on Munro has a size of %u bytes.\n",sizeof(long double));
         18     fprintf(stdout, "Type short on Munro has a size of %u bytes.\n",sizeof(short));
         19     fprintf(stdout, "Type long on Munro has a size of %u bytes.\n",sizeof(long));
         20
         21     int main()
         22     {
         23         datatypes();
         24         return 0;
         24     }
    I got it to show up thw size of each one there with %u and sizeof right but i dont know how the convert each one of them to bits and nibbles in code. anyone can do it on paper but its the code i tried using other things like int bit and nibble and multiple it out but i dont know how to get it to print the output. .. anyhelp wud be appreciated..
    Last edited by Salem; 01-24-2006 at 01:51 AM. Reason: Remove email address

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bits, Bytes & Nibbles!
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 10-13-2001, 10:22 PM