gdata.io.handleScriptLoaded({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$georss":"http://www.georss.org/georss","xmlns$thr":"http://purl.org/syndication/thread/1.0","xmlns$blogger":"http://schemas.google.com/blogger/2008","id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268"},"updated":{"$t":"2023-07-30T02:11:08.392-07:00"},"category":[{"term":"C Programs"},{"term":"Pointers"},{"term":"string"},{"term":"Array"},{"term":"Learn C"},{"term":"Fundamental"},{"term":"Pattern"},{"term":"control sturctures"},{"term":"searching and sorting"},{"term":"recursion"},{"term":"List of C Programs"},{"term":"Structures"},{"term":"C Turbo Compiler"},{"term":"File Handling"},{"term":"Contents"},{"term":"Common Programming Error"},{"term":"functions"},{"term":"Dynamic memory allcation"}],"title":{"type":"text","$t":"C Programming Tutorial"},"subtitle":{"type":"html","$t":"It is a blog about c programming. Here we provide c programs and tutorials to enhance your skills."},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/-/Common+Programming+Error?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/-/Common+Programming+Error?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"alternate","type":"text/html","href":"http://www.comp-psyche.com/search/label/Common%20Programming%20Error"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"generator":{"version":"7.00","uri":"https://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"9"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"50"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-6658161019040712282"},"published":{"$t":"2013-12-03T04:43:00.000-08:00"},"updated":{"$t":"2014-04-16T01:11:11.067-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"File Handling"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERROR - FILE HANDLING"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - FILE HANDLING\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: left;\"\u003e\u003c/div\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eOpening an existing file for \u003cspan style\u003d\"color: lime;\"\u003ewriting ( \"w\") \u003c/span\u003ewhen in fact, the user wants to preserve the file, discards the contents of file without warning.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eForgetting to open a file before attempting to \u003cspan style\u003d\"color: lime;\"\u003ereference\u003c/span\u003e it in a program is a \u003cspan style\u003d\"color: lime;\"\u003elogic error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eopening a \u003cspan style\u003d\"color: lime;\"\u003enonexistent file\u003c/span\u003e for reading is an error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eOpening a file for reading or writing without having been granted the\u003cspan style\u003d\"color: lime;\"\u003e appropriate access rights\u003c/span\u003e to the file ( this is \u003cspan style\u003d\"color: lime;\"\u003eoperating-system dependent\u003c/span\u003e) is an error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eOpening a file for writing when \u003cspan style\u003d\"color: lime;\"\u003eno space\u003c/span\u003e is available is a\u003cspan style\u003d\"color: lime;\"\u003e runtime error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eOpening a file in \u003cspan style\u003d\"color: lime;\"\u003ewrite mode (\"w\")\u003c/span\u003e when it should be opened in update \u003cspan style\u003d\"color: lime;\"\u003emode (\"r+\")\u003c/span\u003e causes the contents of the file to be \u003cspan style\u003d\"color: lime;\"\u003ediscarded\u003c/span\u003e.\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts\u003c/span\u003e\u003c/div\u003e\u003cul style\u003d\"text-align: justify;\"\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors.html\"\u003eCommon Programming Error - Fundamentals\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/06/common-programming-errors_25.html\"\u003eCommon Programming Error - Control Structures\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/6658161019040712282/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-error-file-handling.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/6658161019040712282"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/6658161019040712282"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-error-file-handling.html","title":"COMMON PROGRAMMING ERROR - FILE HANDLING"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-621331994500399760"},"published":{"$t":"2013-12-03T04:42:00.000-08:00"},"updated":{"$t":"2014-04-16T01:11:43.460-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Structures"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - STRUCTURES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - STRUCTURES\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: left;\"\u003e\u003c/div\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eForgetting the \u003cspan style\u003d\"color: lime;\"\u003esemicolon\u003c/span\u003e that terminates a \u003cspan style\u003d\"color: lime;\"\u003estructure definition\u003c/span\u003e is a \u003cspan style\u003d\"color: lime;\"\u003esyntax error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eAssigning a structure of one type to a structure of different type is a \u003cspan style\u003d\"color: lime;\"\u003ecompilation error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eInserting \u003cspan style\u003d\"color: lime;\"\u003espace\u003c/span\u003e between the \u003cspan style\u003d\"color: lime;\"\u003e-\u003c/span\u003e and \u003cspan style\u003d\"color: lime;\"\u003e\u0026gt;\u003c/span\u003e components of the \u003cspan style\u003d\"color: lime;\"\u003estructure pointer operator\u003c/span\u003e is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eAttempting to refer to a member of a structure by using only the \u003cspan style\u003d\"color: lime;\"\u003emember's name\u003c/span\u003e is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eNot using\u003cspan style\u003d\"color: lime;\"\u003e parentheses\u003c/span\u003e when referring to a structure member that uses a pointer and structure member operator is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eAssuming that structures, like arrays, are automatically passed by reference and trying to modify the caller's structure values in the called function is a logic error.\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts\u003c/span\u003e\u003c/div\u003e\u003cul style\u003d\"text-align: justify;\"\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-file-handling.html\"\u003eCommon Programming Error - File Handling\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors.html\"\u003eCommon Programming Error - Fundamentals\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/621331994500399760/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors-structures.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/621331994500399760"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/621331994500399760"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors-structures.html","title":"COMMON PROGRAMMING ERRORS - STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-8998084866353750682"},"published":{"$t":"2013-12-03T04:35:00.000-08:00"},"updated":{"$t":"2014-04-16T01:11:53.604-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"},{"scheme":"http://www.blogger.com/atom/ns#","term":"string"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - STRING"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - STRING\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: left;\"\u003e\u003c/div\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eNot allocating sufficient space in a character array to store the\u003cspan style\u003d\"color: lime;\"\u003e null character\u003c/span\u003e that terminates a string.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003ePrinting a \u003cspan style\u003d\"color: lime;\"\u003e\"string\"\u003c/span\u003e that does not contain \u003cspan style\u003d\"color: lime;\"\u003eterminating null character.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eProcessing a single character as a string. A string is a pointer - probably a respectably large integer. However, a character is a small integer ( ASCII values range 0-255). On many systems this causes an error, because \u003cspan style\u003d\"color: lime;\"\u003elow memory address\u003c/span\u003e are reserved for special purposes such as operating system interrupt handlers. So\u003cspan style\u003d\"color: lime;\"\u003e \"access violation\"\u003c/span\u003e occurs.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003ePassing a character as an argument to a function when a string is expected (and vice versa) is a compilation error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003e\u0026nbsp;Not including the\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003e\u0026lt;string.h\u0026gt;\u003c/span\u003e\u0026nbsp;header when\u0026nbsp;using string functions from the \u003cspan style\u003d\"color: lime;\"\u003estring-handling library.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eNot appending a \u003cspan style\u003d\"color: lime;\"\u003eterminating null character\u003c/span\u003e to the first argument of a\u003cspan style\u003d\"color: lime;\"\u003e strncpy\u003c/span\u003e when the third argument is less than or equal to the length of the string in the second argument.\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-pointers.html\"\u003eCommon Programming Error - Pointers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-structures.html\"\u003eCommon Programming Error - Structures\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/8998084866353750682/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors-string.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/8998084866353750682"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/8998084866353750682"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors-string.html","title":"COMMON PROGRAMMING ERRORS - STRING"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-4403193895303350989"},"published":{"$t":"2013-12-03T04:28:00.000-08:00"},"updated":{"$t":"2014-06-17T03:38:15.798-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS IN C"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003ctitle\u003eCOMMON PROGRAMMING ERRORS IN C\u003c/title\u003e\u003cbr /\u003e\nHere we discuss few common programming errors in c which we often commit. For better understanding we have listed the common programming errors according to topics.\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\" name\u003d\"content\"\u003e\u003cspan style\u003d\"color: yellow; font-weight: normal;\"\u003eCONTENT\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#fundamentals\"\u003eFundamentals\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#control\"\u003eControl Structures\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#function\"\u003eFunction\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#array\"\u003eArray\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#string\"\u003eString\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#pointer\"\u003ePointers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#structure\"\u003eStructures\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#file\"\u003eFile Handling\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#informative\"\u003eMore Informative Posts\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#fundamentals\" name\u003d\"fundamentals\"\u003e\u003cspan style\u003d\"color: yellow; font-weight: normal;\"\u003eFUNDAMENTALS\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\"\u003eBack to content\u003c/a\u003e\u003cbr /\u003e\n\u003col\u003e\n\u003cli\u003eNot putting semicolon after C statements like\u0026nbsp;\u003ci\u003e\u003cspan style\u003d\"color: lime;\"\u003eprintf()\u0026nbsp;\u003c/span\u003e\u003c/i\u003eor\u003ci\u003e\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003escanf()\u003c/span\u003e\u003c/i\u003e\u003cspan style\u003d\"color: lime;\"\u003e.\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003eNot including required header files.\u003c/li\u003e\n\u003cli\u003e\u003cspan style\u003d\"color: lime;\"\u003eParenthesis\u003c/span\u003e\u0026nbsp;not matching in\u0026nbsp;\u003ci\u003e\u003cspan style\u003d\"color: lime;\"\u003eprintf()\u003c/span\u003e\u0026nbsp;or\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003escanf().\u003c/span\u003e\u003c/i\u003e\u003c/li\u003e\n\u003cli\u003eNot including\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003edouble quotes\u003c/span\u003e\u0026nbsp;in\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003e\u003ci\u003eprintf()\u003c/i\u003e.\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003eNot putting comma between identifiers.\u003c/li\u003e\n\u003cli\u003eIncluding space in identifiers.\u003c/li\u003e\n\u003cli\u003eusing\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ewrong conversion character\u003c/span\u003e\u0026nbsp;in\u0026nbsp;\u003ci\u003escanf()\u0026nbsp;\u003c/i\u003eor\u0026nbsp;\u003ci\u003eprintf()\u003c/i\u003e.\u003c/li\u003e\n\u003cli\u003eNot including\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;address of operator\u003c/span\u003e\u0026nbsp;( \u0026amp; ) in\u0026nbsp;\u003ci\u003escanf().\u003c/i\u003e\u003c/li\u003e\n\u003cli\u003eUsing\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003eaddress of operator\u003c/span\u003e\u0026nbsp;( \u0026amp; ) in\u0026nbsp;\u003ci\u003eprintf()\u003c/i\u003e.\u003c/li\u003e\n\u003cli\u003eNot giving precedence to expression wherever required like\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ea\u0026nbsp;+ b / 2\u003c/span\u003e\u0026nbsp;is different from\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;( a\u0026nbsp;+ b ) / 2.\u003c/span\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#control\" name\u003d\"control\"\u003e\u003cspan style\u003d\"color: yellow; font-weight: normal;\"\u003eCONTROL STRUCTURES\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\"\u003eBack to content\u003c/a\u003e\u003cbr /\u003e\n\u003col\u003e\n\u003cli\u003eInserting semicolons at the end of expression in for loop or while loop or if or switch.\u0026nbsp;\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv\u003e\n\u003cb\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/b\u003e\u003cspan style\u003d\"color: yellow;\"\u003eFor example:\u003c/span\u003e\u003c/div\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/span\u003e\u003cspan style\u003d\"color: lime;\"\u003e \u0026nbsp;for ( a \u003d 4; a \u0026lt;\u003d 10; a++);\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; printf ( \"%d\", a );\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003c/span\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u0026nbsp; \u0026nbsp; 2. \u0026nbsp; Not inserting semicolon at the end of expression of while in do-while loop.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u0026nbsp; \u0026nbsp; 3. \u0026nbsp; Not including curly braces to include if or loop statements.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u0026nbsp; \u0026nbsp; 4. \u0026nbsp; Using an assignment operator in if expression instead of equality operator.\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ch2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#function\" name\u003d\"function\"\u003e\u003cspan style\u003d\"font-weight: normal;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003eCOMMON PROGRAMMING ERRORS - FUNCTION\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\"\u003eBack to content\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cul\u003e\n\u003cli\u003eForget to put a semicolon at the end of prototype or function declaration.\u003c/li\u003e\n\u003cli\u003eSpecifying function parameters of the same type as\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003edouble x,y\u003c/span\u003e\u0026nbsp;instead of\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003edouble x, double y\u003c/span\u003e\u0026nbsp;results in a compilation error.\u003c/li\u003e\n\u003cul\u003e\u003c/ul\u003e\n\u003c/ul\u003e\n\u003cul\u003e\n\u003cli\u003ePut a semicolon at the end of function header while defining the function.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b); \u0026nbsp;// error\u0026nbsp;\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return a/b;\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cul\u003e\n\u003cli\u003eType mismatch error due to difference in the types in function declaration and function definition. The types of parameter may differ.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul\u003e\n\u003cli\u003eType mismatch error due to difference in the order of parameters in function declaration and function definition.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul\u003e\n\u003cli\u003eType mismatch error due to difference in the number of actual arguments and the number of formal arguments.\u003c/li\u003e\n\u003cli\u003eDefining a function inside another function is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul\u003e\n\u003cli\u003eDefining a local variable within a function with the same name as formal argument name.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b)\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; int a; //error defining the same variable\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cul\u003e\n\u003cli\u003eNot returning any value when the function return type is not valid.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; For example:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; float division(float a, int b)\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;{\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return ;\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;}\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cbr /\u003e\n\u003ch2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#array\" name\u003d\"array\"\u003e\u003cspan style\u003d\"color: yellow; font-weight: normal;\"\u003eARRAY\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\"\u003eBack to content\u003c/a\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eDeclaring an array\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ewithout specifying any value\u003c/span\u003e\u0026nbsp;as size of array.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eDeclaring an array taking\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003evariable n\u003c/span\u003e\u0026nbsp;as size of array.\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003eC\u003c/span\u003e\u0026nbsp;does not allow a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003evariable length array.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eInitializing\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003emore values\u003c/span\u003e\u0026nbsp;than the\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003especified size.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eAccessing array elements\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ebeyond the range limits.\u003c/span\u003e\u0026nbsp;\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eArray elements are to be used from\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003e0 to maxsize-1.\u0026nbsp;\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eC\u003c/span\u003e\u0026nbsp;does not report any error if user tries to access elements beyond this range but some\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003egarbage value is printed.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eDeclaring array of\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003etype void.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2\u003e\n\u003cspan style\u003d\"color: yellow; font-weight: normal;\"\u003e\u003cbr /\u003e\n\u003c/span\u003e\u003c/h2\u003e\n\u003ch2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#string\" name\u003d\"string\"\u003e\u003cspan style\u003d\"color: yellow; font-weight: normal;\"\u003eSTRING\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\"\u003eBack to content\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eNot allocating sufficient space in a character array to store the\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;null character\u003c/span\u003e\u0026nbsp;that terminates a string.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003ePrinting a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003e\"string\"\u003c/span\u003e\u0026nbsp;that does not contain\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003eterminating null character.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eProcessing a single character as a string. A string is a pointer - probably a respectably large integer. However, a character is a small integer ( ASCII values range 0-255). On many systems this causes an error, because\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003elow memory address\u003c/span\u003e\u0026nbsp;are reserved for special purposes such as operating system interrupt handlers. So\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;\"access violation\"\u003c/span\u003e\u0026nbsp;occurs.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003ePassing a character as an argument to a function when a string is expected (and vice versa) is a compilation error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u0026nbsp;Not including the\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003e\u0026lt;string.h\u0026gt;\u003c/span\u003e\u0026nbsp;header when\u0026nbsp;using string functions from the\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003estring-handling library.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eNot appending a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003eterminating null character\u003c/span\u003e\u0026nbsp;to the first argument of a\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;strncpy\u003c/span\u003e\u0026nbsp;when the third argument is less than or equal to the length of the string in the second argument.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003ch2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#pointer\" name\u003d\"pointer\"\u003e\u003cspan style\u003d\"color: yellow; font-weight: normal;\"\u003eCOMMON PROGRAMMING ERRORS - POINTERS\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\"\u003eBack to content\u003c/a\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eThe\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003easterisk(*)\u003c/span\u003e\u0026nbsp;notation used to declare pointer variables does not distribute to all variable names in a declaration. Each pointer must be declared with the\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;*\u003c/span\u003e\u0026nbsp;prefixed to the name. Eg:\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003eint *x,*y;\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eDereferencing a pointer that has not been properly initialized or that has not been assigned to point to a specific location in memory is an error. This could cause a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003efatal execution time error,\u003c/span\u003e\u0026nbsp;or it could accidently\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003emodify important data\u003c/span\u003e\u0026nbsp;and allow the program to run to completion with\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;incorrect result.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eBeing unaware that a \u0026nbsp;function is expecting pointers as arguments for\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003epass-by-reference\u003c/span\u003e\u0026nbsp;and\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;passing arguments by value.\u003c/span\u003e\u0026nbsp;Some compilers take the values assuming they're pointers and dereference the values as pointers. At run time,\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ememory-access\u003c/span\u003e\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003eviolation\u003c/span\u003e\u0026nbsp;or\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003esegmentation faults\u003c/span\u003e\u0026nbsp;are often generated. Other compilers catch the mismatch in types between arguments and parameters and generate error messages.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eUsing pointer arithmetic on a pointer that does not refer to an element in an array.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eSubtracting\u003c/span\u003e\u0026nbsp;or\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ecomparing\u003c/span\u003e\u0026nbsp;two pointers that do not refer to elements in the same array.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eRunning off\u003c/span\u003e\u0026nbsp;either end of an array when using\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003epointer arithmetic.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eAssigning pointer\u003c/span\u003e\u0026nbsp;of one type to a pointer of another type if neither is of type\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003evoid *\u003c/span\u003e\u0026nbsp;is a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003esyntax error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eDereferencing\u003c/span\u003e\u0026nbsp;a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003evoid *\u003c/span\u003e\u0026nbsp;pointer is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eAttempting to\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003emodify an array name\u003c/span\u003e\u0026nbsp;with\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;pointer arithmetic\u003c/span\u003e\u0026nbsp;is a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ecompilation error.\u003c/span\u003e\u0026nbsp;\u003c/li\u003e\n\u003c/ul\u003e\n\u003cbr /\u003e\n\u003ch2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#structure\" name\u003d\"structure\"\u003e\u003cspan style\u003d\"color: yellow; font-weight: normal;\"\u003eSTRUCTURES\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\"\u003eBack to content\u003c/a\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eForgetting the\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003esemicolon\u003c/span\u003e\u0026nbsp;that terminates a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003estructure definition\u003c/span\u003e\u0026nbsp;is a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003esyntax error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eAssigning a structure of one type to a structure of different type is a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ecompilation error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eInserting\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003espace\u003c/span\u003e\u0026nbsp;between the\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003e-\u003c/span\u003e\u0026nbsp;and\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003e\u0026gt;\u003c/span\u003e\u0026nbsp;components of the\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003estructure pointer operator\u003c/span\u003e\u0026nbsp;is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eAttempting to refer to a member of a structure by using only the\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003emember's name\u003c/span\u003e\u0026nbsp;is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eNot using\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;parentheses\u003c/span\u003e\u0026nbsp;when referring to a structure member that uses a pointer and structure member operator is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eAssuming that structures, like arrays, are automatically passed by reference and trying to modify the caller's structure values in the called function is a logic error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cbr /\u003e\n\u003ch2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#file\" name\u003d\"file\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003cspan style\u003d\"font-weight: normal;\"\u003eFILE HANDLING\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#content\"\u003eBack to content\u003c/a\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eOpening an existing file for\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ewriting ( \"w\")\u0026nbsp;\u003c/span\u003ewhen in fact, the user wants to preserve the file, discards the contents of file without warning.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eForgetting to open a file before attempting to\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ereference\u003c/span\u003e\u0026nbsp;it in a program is a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003elogic error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eopening a\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003enonexistent file\u003c/span\u003e\u0026nbsp;for reading is an error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eOpening a file for reading or writing without having been granted the\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;appropriate access rights\u003c/span\u003e\u0026nbsp;to the file ( this is\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003eoperating-system dependent\u003c/span\u003e) is an error.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eOpening a file for writing when\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003eno space\u003c/span\u003e\u0026nbsp;is available is a\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp;runtime error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003eOpening a file in\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003ewrite mode (\"w\")\u003c/span\u003e\u0026nbsp;when it should be opened in update\u0026nbsp;\u003cspan style\u003d\"color: lime;\"\u003emode (\"r+\")\u003c/span\u003e\u0026nbsp;causes the contents of the file to be \u003cspan style\u003d\"color: lime;\"\u003ediscarded.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: left;\"\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#informative\" name\u003d\"informative\" span\u003d\"\" style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/a\u003e\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cspan style\u003d\"line-height: 24px;\"\u003e\u003c/span\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/10/pointers-and-structures.html\"\u003ePointers And Structures\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/10/array-of-structures.html\"\u003eArray Of Structures\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/10/structure-and-funciton.html\"\u003eStructure And Function\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/4403193895303350989/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/4403193895303350989"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/4403193895303350989"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html","title":"COMMON PROGRAMMING ERRORS IN C"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"},"georss$featurename":{"$t":"United States"},"georss$point":{"$t":"37.09024 -95.71289100000001"},"georss$box":{"$t":"23.559521500000002 -116.36718800000001 50.6209585 -75.05859400000001"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-7709750115090501216"},"published":{"$t":"2013-11-29T00:05:00.000-08:00"},"updated":{"$t":"2014-04-16T01:12:09.939-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Pointers"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - POINTERS"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - POINTERS\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: left;\"\u003e\u003c/div\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eThe \u003cspan style\u003d\"color: lime;\"\u003easterisk(*)\u003c/span\u003e notation used to declare pointer variables does not distribute to all variable names in a declaration. Each pointer must be declared with the\u003cspan style\u003d\"color: lime;\"\u003e *\u003c/span\u003e prefixed to the name. Eg: \u003cspan style\u003d\"color: lime;\"\u003eint *x,*y;\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eDereferencing a pointer that has not been properly initialized or that has not been assigned to point to a specific location in memory is an error. This could cause a \u003cspan style\u003d\"color: lime;\"\u003efatal execution time error,\u003c/span\u003e or it could accidently \u003cspan style\u003d\"color: lime;\"\u003emodify important data\u003c/span\u003e and allow the program to run to completion with\u003cspan style\u003d\"color: lime;\"\u003e incorrect result.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eBeing unaware that a \u0026nbsp;function is expecting pointers as arguments for \u003cspan style\u003d\"color: lime;\"\u003epass-by-reference\u003c/span\u003e and\u003cspan style\u003d\"color: lime;\"\u003e passing arguments by value.\u003c/span\u003e Some compilers take the values assuming they're pointers and dereference the values as pointers. At run time, \u003cspan style\u003d\"color: lime;\"\u003ememory-access\u003c/span\u003e \u003cspan style\u003d\"color: lime;\"\u003eviolation\u003c/span\u003e or \u003cspan style\u003d\"color: lime;\"\u003esegmentation faults\u003c/span\u003e are often generated. Other compilers catch the mismatch in types between arguments and parameters and generate error messages.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eUsing pointer arithmetic on a pointer that does not refer to an element in an array.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eSubtracting\u003c/span\u003e or \u003cspan style\u003d\"color: lime;\"\u003ecomparing\u003c/span\u003e two pointers that do not refer to elements in the same array.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eRunning off\u003c/span\u003e either end of an array when using \u003cspan style\u003d\"color: lime;\"\u003epointer arithmetic.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eAssigning pointer\u003c/span\u003e of one type to a pointer of another type if neither is of type \u003cspan style\u003d\"color: lime;\"\u003evoid *\u003c/span\u003e is a \u003cspan style\u003d\"color: lime;\"\u003esyntax error.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eDereferencing\u003c/span\u003e a \u003cspan style\u003d\"color: lime;\"\u003evoid *\u003c/span\u003e pointer is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eAttempting to \u003cspan style\u003d\"color: lime;\"\u003emodify an array name\u003c/span\u003e with\u003cspan style\u003d\"color: lime;\"\u003e pointer arithmetic\u003c/span\u003e is a \u003cspan style\u003d\"color: lime;\"\u003ecompilation error.\u003c/span\u003e\u0026nbsp;\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-structures.html\"\u003eCommon Programming Error - Structures\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-file-handling.html\"\u003eCommon Programming Error - File Handling\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/7709750115090501216/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors-pointers.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/7709750115090501216"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/7709750115090501216"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors-pointers.html","title":"COMMON PROGRAMMING ERRORS - POINTERS"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-1749873683105783588"},"published":{"$t":"2013-11-26T00:36:00.001-08:00"},"updated":{"$t":"2014-04-16T01:12:59.608-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Array"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - ARRAY"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - ARRAY\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: left;\"\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: left;\"\u003e\u003c/div\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eDeclaring an array \u003cspan style\u003d\"color: lime;\"\u003ewithout specifying any value\u003c/span\u003e as size of array.\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eDeclaring an array taking \u003cspan style\u003d\"color: lime;\"\u003evariable n\u003c/span\u003e as size of array. \u003cspan style\u003d\"color: lime;\"\u003eC\u003c/span\u003e does not allow a \u003cspan style\u003d\"color: lime;\"\u003evariable length array.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eInitializing \u003cspan style\u003d\"color: lime;\"\u003emore values\u003c/span\u003e than the \u003cspan style\u003d\"color: lime;\"\u003especified size.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eAccessing array elements \u003cspan style\u003d\"color: lime;\"\u003ebeyond the range limits.\u003c/span\u003e\u0026nbsp;\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eArray elements are to be used from \u003cspan style\u003d\"color: lime;\"\u003e0 to maxsize-1.\u0026nbsp;\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003eC\u003c/span\u003e does not report any error if user tries to access elements beyond this range but some \u003cspan style\u003d\"color: lime;\"\u003egarbage value is printed.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cul style\u003d\"text-align: left;\"\u003e\u003cli style\u003d\"text-align: justify;\"\u003eDeclaring array of \u003cspan style\u003d\"color: lime;\"\u003etype void.\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cdiv\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-string.html\"\u003eCommon Programming Error - String\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-pointers.html\"\u003eCommon Programming Error - Pointers\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/1749873683105783588/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors-array.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/1749873683105783588"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/1749873683105783588"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors-array.html","title":"COMMON PROGRAMMING ERRORS - ARRAY"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-5273556307859903472"},"published":{"$t":"2013-11-24T02:04:00.000-08:00"},"updated":{"$t":"2014-04-23T22:51:33.996-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"},{"scheme":"http://www.blogger.com/atom/ns#","term":"functions"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERROR - FUNCTION"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003eHere is a list of few common programming errors committed by us in function. For complete list of common programming errors visit : \u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\" target\u003d\"_blank\"\u003eCommon Programming Errors In C\u003c/a\u003e\u003cbr /\u003e\n\u003cul\u003e\u003cli\u003eForget to put a semicolon at the end of prototype or function declaration.\u003c/li\u003e\n\u003cli\u003eSpecifying function parameters of the same type as \u003cspan style\u003d\"color: lime;\"\u003edouble x,y\u003c/span\u003e instead of \u003cspan style\u003d\"color: lime;\"\u003edouble x, double y\u003c/span\u003e results in a compilation error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul\u003e\u003cli\u003ePut a semicolon at the end of function header while defining the function.\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b); \u0026nbsp;// error\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return a/b;\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cul\u003e\u003cli\u003eType mismatch error due to difference in the types in function declaration and function definition. The types of parameter may differ.\u003c/li\u003e\n\u003c/ul\u003e\u003cul\u003e\u003cli\u003eType mismatch error due to difference in the order of parameters in function declaration and function definition.\u003c/li\u003e\n\u003c/ul\u003e\u003cul\u003e\u003cli\u003eType mismatch error due to difference in the number of actual arguments and the number of formal arguments.\u003c/li\u003e\n\u003cli\u003eDefining a function inside another function is a syntax error.\u003c/li\u003e\n\u003c/ul\u003e\u003cul\u003e\u003cli\u003eDefining a local variable within a function with the same name as formal argument name.\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b)\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; int a; //error defining the same variable\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cul\u003e\u003cli\u003eNot returning any value when the function return type is not valid.\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; For example:\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; float division(float a, int b)\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;{\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return ;\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: lime;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;}\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cbr /\u003e\n\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cdiv\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eLearn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-array.html\"\u003eCommon Programming Error - Array\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-string.html\"\u003eCommon Programming Error - String\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/5273556307859903472/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-error-function.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5273556307859903472"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5273556307859903472"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-error-function.html","title":"COMMON PROGRAMMING ERROR - FUNCTION"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-3214615755517805421"},"published":{"$t":"2013-11-18T07:20:00.000-08:00"},"updated":{"$t":"2014-04-16T01:12:37.357-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - CONTROL STRUCTURES\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003c/div\u003e\u003col\u003e\u003cli\u003eInserting semicolons at the end of expression in for loop or while loop or if or switch.\u0026nbsp;\u003c/li\u003e\n\u003c/ol\u003e\u003cdiv\u003e\u003cb\u003eFor example:\u003c/b\u003e\u003c/div\u003e\u003cdiv class\u003d\"mokcode\"\u003e\u003cspan style\u003d\"color: blue;\"\u003efor ( a \u003d 4; a \u0026lt;\u003d 10; a++);\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e{\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e\u0026nbsp; \u0026nbsp;printf ( \"%d\", a );\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e}\u003c/span\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u0026nbsp; 2. \u0026nbsp; Not inserting semicolon at the end of expression of while in do-while loop.\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u0026nbsp; 3. \u0026nbsp; Not including curly braces to include if or loop statements.\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u0026nbsp; 4. \u0026nbsp; Using an assignment operator in if expression instead of equality operator.\u003c/div\u003e\u003cdiv\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u003cbr /\u003e\n\u003cdiv\u003e\u003cdiv\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-function.html\"\u003eCommon Programming Error - Function\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-array.html\"\u003eCommon Programming Error - Array\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/3214615755517805421/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/06/common-programming-errors_25.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/3214615755517805421"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/3214615755517805421"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/06/common-programming-errors_25.html","title":"COMMON PROGRAMMING ERRORS - CONTROL STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-473472171935997281"},"published":{"$t":"2013-11-18T00:40:00.000-08:00"},"updated":{"$t":"2014-04-16T01:12:46.729-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Fundamental"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - FUNDAMENTALS"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - FUNDAMENTALS\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003c/div\u003e\u003col\u003e\u003cli\u003eNot putting semicolon after C statements like \u003ci\u003e\u003cspan style\u003d\"color: lime;\"\u003eprintf() \u003c/span\u003e\u003c/i\u003eor\u003ci\u003e \u003cspan style\u003d\"color: lime;\"\u003escanf()\u003c/span\u003e\u003c/i\u003e\u003cspan style\u003d\"color: lime;\"\u003e.\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003eNot including required header files.\u003c/li\u003e\n\u003cli\u003e\u003cspan style\u003d\"color: lime;\"\u003eParenthesis\u003c/span\u003e not matching in \u003ci\u003e\u003cspan style\u003d\"color: lime;\"\u003eprintf()\u003c/span\u003e or \u003cspan style\u003d\"color: lime;\"\u003escanf().\u003c/span\u003e\u003c/i\u003e\u003c/li\u003e\n\u003cli\u003eNot including \u003cspan style\u003d\"color: lime;\"\u003edouble quotes\u003c/span\u003e in \u003cspan style\u003d\"color: lime;\"\u003e\u003ci\u003eprintf()\u003c/i\u003e.\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003eNot putting comma between identifiers.\u003c/li\u003e\n\u003cli\u003eIncluding space in identifiers.\u003c/li\u003e\n\u003cli\u003eusing \u003cspan style\u003d\"color: lime;\"\u003ewrong conversion character\u003c/span\u003e in \u003ci\u003escanf() \u003c/i\u003eor \u003ci\u003eprintf()\u003c/i\u003e.\u003c/li\u003e\n\u003cli\u003eNot including\u003cspan style\u003d\"color: lime;\"\u003e address of operator\u003c/span\u003e ( \u0026amp; ) in \u003ci\u003escanf().\u003c/i\u003e\u003c/li\u003e\n\u003cli\u003eUsing \u003cspan style\u003d\"color: lime;\"\u003eaddress of operator\u003c/span\u003e ( \u0026amp; ) in \u003ci\u003eprintf()\u003c/i\u003e.\u003c/li\u003e\n\u003cli\u003eNot giving precedence to expression wherever required like \u003cspan style\u003d\"color: lime;\"\u003ea\u0026nbsp;+ b / 2\u003c/span\u003e is different from\u003cspan style\u003d\"color: lime;\"\u003e ( a\u0026nbsp;+ b ) / 2.\u003c/span\u003e\u003c/li\u003e\n\u003c/ol\u003e\u003cdiv\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/06/common-programming-errors_25.html\"\u003eCommon Programming Error - Control Structures\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-function.html\"\u003eCommon Programming Error - Function\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/473472171935997281/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/473472171935997281"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/473472171935997281"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors.html","title":"COMMON PROGRAMMING ERRORS - FUNDAMENTALS"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}}]}});