Thread: Machine Statements

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    21

    Question Machine Statements

    Hi all,
    i'm new to C, could anyone give brief information about machine statements,why its used?

    thanks and regards,
    Sri

  2. #2
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    What do you mean by "machine statements"?
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    21
    Bull ............if u dont know shut your mouth up...

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    21
    claudiu shut ur mouth up

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    mgnidhi_3july: you might want to read the forum guidelines. Your retort comes very close to getting you a warning under rule #7.

    Back to the question: what exactly do you mean by "machine statements"? Are you talking about the use of inline assembly?
    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

  6. #6
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by mgnidhi_3july View Post
    claudiu shut ur mouth up
    LOL? Ok, I'm gonna be all quiet! I was trying to help you out but I guess you know what's best for you.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    I think they're referring to state machines, re: posting on the end of this thread.
    interview Q and A i encountered - BOKIBOAZ

    But given the outburst, I'm somewhat dis-inclined to bother helping the OP anymore.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User Sharke's Avatar
    Join Date
    Jun 2008
    Location
    NYC
    Posts
    303
    Comedy gold!

  9. #9
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Wow. That's not just inappropriate, it's INSANE. You are INSANE. Seek help.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  10. #10
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    I'm guessing that mgnidhi_3july thought claudiu's signature was directed specifically at him/her.
    Not that that is any kind of reasonable excuse.

    I would have to guess that "machine statements" are used simply because they are. If that's not tha answer you were looking for then Google is your friend.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Will my memory leak? --school project
    By steals10304 in forum C++ Programming
    Replies: 10
    Last Post: 02-24-2010, 03:04 PM
  2. Using ip tables to forward port to virtual machine
    By sean in forum Networking/Device Communication
    Replies: 1
    Last Post: 10-31-2009, 09:16 AM
  3. Finite State Machine
    By ArlexBee-871RBO in forum C++ Programming
    Replies: 8
    Last Post: 07-14-2008, 11:59 AM
  4. Efficiency of case statements
    By Yasir_Malik in forum C Programming
    Replies: 26
    Last Post: 05-23-2006, 11:36 AM
  5. Porting from 32 bit machine to 64 bit machine!
    By anoopks in forum C Programming
    Replies: 10
    Last Post: 02-25-2005, 08:02 PM