Like Tree3Likes

datatype deduction

This is a discussion on datatype deduction within the C Programming forums, part of the General Programming Boards category; I am unable to understand mam,what you say... I am quite new to C...

  1. #16
    Registered User
    Join Date
    Aug 2012
    Posts
    73
    I am unable to understand mam,what you say...
    I am quite new to C

  2. #17
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,772
    Well... here's an example:
    Code:
    #include <stdio.h>
    
    int main(void)
    {
        int a[2];
        printf("For integer data type: Bytes stored = %d\n", (char*)&a[1] - (char*)&a[0]);
        return 0;
    }
    If you still don't understand this or why it works, then I suggest that you leave this trivia question aside for the time being and continue learning to program in C.
    progmateur likes this.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #18
    Registered User
    Join Date
    Aug 2012
    Posts
    73
    Thanks a lot for your code and suggestions.
    But truely I do not understand it til now...
    But it working fine fine

    Thanks a tonne!

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Test datatype
    By tsmith94 in forum C Programming
    Replies: 2
    Last Post: 11-27-2011, 07:56 PM
  2. Templates: type deduction question
    By Elysia in forum C++ Programming
    Replies: 4
    Last Post: 06-04-2010, 04:28 PM
  3. datatype bit?
    By MK27 in forum C Programming
    Replies: 3
    Last Post: 02-05-2009, 12:56 PM
  4. Datatype
    By ssharish2005 in forum C Programming
    Replies: 6
    Last Post: 08-04-2008, 12:53 PM
  5. Implicit template argument deduction for classes
    By drrngrvy in forum C++ Programming
    Replies: 12
    Last Post: 03-30-2007, 05:31 PM

Tags for this Thread


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