Thread: Type Casting Question

  1. #31
    Registered User
    Join Date
    May 2008
    Posts
    11
    Quote Originally Posted by quzah View Post
    What pattern? There is no pattern here. Just you sticking bytes into an array.

    Read: Integer overflow - Wikipedia, the free encyclopedia

    Your cast doesn't matter at all there. For that matter, it isn't even going to matter when you display it, because if you are using say %x + printf, it is effectively typecasting to an unsigned int anyway!


    Quzah.
    Are you saying that foo won't be 0x11, 0xff, 0xaa or 0x55? and the pattern I want it to get is 0b00010001, 0b11111111, 0b10101010 or 0b01010101. I believe this has no much to do with overflow.

  2. #32
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    I am done talking to you about this since you do not follow the forum guidlines. Editing the original post to take out the question is extremely rude and counter productive to what this board does. You just invalidated all the work people volunteered their time to help you with.

    Quote Originally Posted by HW POLICY - FORUM GUIDLINES
    Please note that this is a public forum. Posts that include parts of assignments are free for anyone to see. It is board policy to encourage the sharing of information and to help people learn to program. Therefore, we avoid deleting posts. If your question is specific to a certain assignment, be aware that it will be visible to the public, and it is our policy NOT to delete posts. It is possible your work may be copied by others.
    EDIT: Someone should lock this thread
    Last edited by AndrewHunter; 08-10-2011 at 07:19 PM.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #33
    Registered User
    Join Date
    May 2008
    Posts
    11
    Quote Originally Posted by AndrewHunter View Post
    I am done talking to you about this since you do not follow the forum guidlines. Editing the original post to take out the question is extremely rude and counter productive to what this board does. You just invalidated all the work people volunteered their time to help you with.



    EDIT: Someone should lock this thread
    I thank the REAL help. the rest? I feel what i did was propitiate. don't like it? report me or band me if you like.

    I'm rude? some of you are not much better either. and I think i 'm done with you too. jerk!

  4. #34
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by firebird View Post
    report me or band me if you like.
    Done...

    (Where's Salem when we need him...)

  5. #35
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,401
    I've restored the original post.
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Advantages of c++ type casting over c type casting
    By kaibalya2008 in forum C++ Programming
    Replies: 10
    Last Post: 05-05-2009, 11:09 AM
  2. type casting in C++
    By WDT in forum Networking/Device Communication
    Replies: 9
    Last Post: 10-15-2007, 10:18 AM
  3. difference between type conversion and type casting
    By Bargi in forum C Programming
    Replies: 1
    Last Post: 01-23-2007, 03:17 AM
  4. type casting or not?
    By siavoshkc in forum C++ Programming
    Replies: 8
    Last Post: 03-19-2006, 08:20 PM
  5. type casting
    By cyberCLoWn in forum C++ Programming
    Replies: 3
    Last Post: 12-31-2003, 08:13 AM