// API callback
relpostimgcuplik({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$blogger":"http://schemas.google.com/blogger/2008","xmlns$georss":"http://www.georss.org/georss","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$thr":"http://purl.org/syndication/thread/1.0","id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268"},"updated":{"$t":"2023-07-30T02:11:08.392-07:00"},"category":[{"term":"C Programs"},{"term":"Learn C"},{"term":"Common Programming Error"},{"term":"searching and sorting"},{"term":"control sturctures"},{"term":"Fundamental"},{"term":"List of C Programs"},{"term":"string"},{"term":"Array"},{"term":"Pattern"},{"term":"Contents"},{"term":"Pointers"},{"term":"functions"},{"term":"Dynamic memory allcation"},{"term":"recursion"},{"term":"C Turbo Compiler"},{"term":"File Handling"},{"term":"Structures"}],"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.comp-psyche.com\/feeds\/posts\/default"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/-\/Common+Programming+Error?alt=json-in-script\u0026max-results=50"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/search\/label\/Common%20Programming%20Error"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"generator":{"version":"7.00","uri":"http://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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - FILE HANDLING\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EOpening an existing file for \u003Cspan style=\"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=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EForgetting to open a file before attempting to \u003Cspan style=\"color: lime;\"\u003Ereference\u003C\/span\u003E it in a program is a \u003Cspan style=\"color: lime;\"\u003Elogic error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003Eopening a \u003Cspan style=\"color: lime;\"\u003Enonexistent file\u003C\/span\u003E for reading is an error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EOpening a file for reading or writing without having been granted the\u003Cspan style=\"color: lime;\"\u003E appropriate access rights\u003C\/span\u003E to the file ( this is \u003Cspan style=\"color: lime;\"\u003Eoperating-system dependent\u003C\/span\u003E) is an error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EOpening a file for writing when \u003Cspan style=\"color: lime;\"\u003Eno space\u003C\/span\u003E is available is a\u003Cspan style=\"color: lime;\"\u003E runtime error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EOpening a file in \u003Cspan style=\"color: lime;\"\u003Ewrite mode (\"w\")\u003C\/span\u003E when it should be opened in update \u003Cspan style=\"color: lime;\"\u003Emode (\"r+\")\u003C\/span\u003E causes the contents of the file to be \u003Cspan style=\"color: lime;\"\u003Ediscarded\u003C\/span\u003E.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts\u003C\/span\u003E\u003C\/div\u003E\u003Cul style=\"text-align: justify;\"\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EForgetting the \u003Cspan style=\"color: lime;\"\u003Esemicolon\u003C\/span\u003E that terminates a \u003Cspan style=\"color: lime;\"\u003Estructure definition\u003C\/span\u003E is a \u003Cspan style=\"color: lime;\"\u003Esyntax error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAssigning a structure of one type to a structure of different type is a \u003Cspan style=\"color: lime;\"\u003Ecompilation error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EInserting \u003Cspan style=\"color: lime;\"\u003Espace\u003C\/span\u003E between the \u003Cspan style=\"color: lime;\"\u003E-\u003C\/span\u003E and \u003Cspan style=\"color: lime;\"\u003E\u0026gt;\u003C\/span\u003E components of the \u003Cspan style=\"color: lime;\"\u003Estructure pointer operator\u003C\/span\u003E is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAttempting to refer to a member of a structure by using only the \u003Cspan style=\"color: lime;\"\u003Emember's name\u003C\/span\u003E is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003ENot using\u003Cspan style=\"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=\"text-align: left;\"\u003E\u003Cli style=\"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=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts\u003C\/span\u003E\u003C\/div\u003E\u003Cul style=\"text-align: justify;\"\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - STRING\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003ENot allocating sufficient space in a character array to store the\u003Cspan style=\"color: lime;\"\u003E null character\u003C\/span\u003E that terminates a string.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EPrinting a \u003Cspan style=\"color: lime;\"\u003E\"string\"\u003C\/span\u003E that does not contain \u003Cspan style=\"color: lime;\"\u003Eterminating null character.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"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=\"color: lime;\"\u003Elow memory address\u003C\/span\u003E are reserved for special purposes such as operating system interrupt handlers. So\u003Cspan style=\"color: lime;\"\u003E \"access violation\"\u003C\/span\u003E occurs.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"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=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u0026nbsp;Not including the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E\u0026lt;string.h\u0026gt;\u003C\/span\u003E\u0026nbsp;header when\u0026nbsp;using string functions from the \u003Cspan style=\"color: lime;\"\u003Estring-handling library.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003ENot appending a \u003Cspan style=\"color: lime;\"\u003Eterminating null character\u003C\/span\u003E to the first argument of a\u003Cspan style=\"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=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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=\"ltr\" style=\"text-align: left;\" trbidi=\"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=\"text-align: left;\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\" name=\"content\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ECONTENT\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Cdiv\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli\u003E\u003Ca href=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"text-align: left;\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#fundamentals\" name=\"fundamentals\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003EFUNDAMENTALS\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"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=\"color: lime;\"\u003Eprintf()\u0026nbsp;\u003C\/span\u003E\u003C\/i\u003Eor\u003Ci\u003E\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Escanf()\u003C\/span\u003E\u003C\/i\u003E\u003Cspan style=\"color: lime;\"\u003E.\u003C\/span\u003E\u003C\/li\u003E\n\u003Cli\u003ENot including required header files.\u003C\/li\u003E\n\u003Cli\u003E\u003Cspan style=\"color: lime;\"\u003EParenthesis\u003C\/span\u003E\u0026nbsp;not matching in\u0026nbsp;\u003Ci\u003E\u003Cspan style=\"color: lime;\"\u003Eprintf()\u003C\/span\u003E\u0026nbsp;or\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Escanf().\u003C\/span\u003E\u003C\/i\u003E\u003C\/li\u003E\n\u003Cli\u003ENot including\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Edouble quotes\u003C\/span\u003E\u0026nbsp;in\u0026nbsp;\u003Cspan style=\"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=\"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=\"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=\"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=\"color: lime;\"\u003Ea\u0026nbsp;+ b \/ 2\u003C\/span\u003E\u0026nbsp;is different from\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;( a\u0026nbsp;+ b ) \/ 2.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ol\u003E\n\u003Ch2 style=\"text-align: left;\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#control\" name=\"control\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ECONTROL STRUCTURES\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"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=\"color: yellow;\"\u003EFor example:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"color: lime;\"\u003E \u0026nbsp;for ( a = 4; a \u0026lt;= 10; a++);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; printf ( \"%d\", a );\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cdiv style=\"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=\"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=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#function\" name=\"function\"\u003E\u003Cspan style=\"font-weight: normal;\"\u003E\u003Cspan style=\"color: yellow;\"\u003ECOMMON PROGRAMMING ERRORS - FUNCTION\u003C\/span\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"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=\"color: lime;\"\u003Edouble x,y\u003C\/span\u003E\u0026nbsp;instead of\u0026nbsp;\u003Cspan style=\"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=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"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=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"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=\"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=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"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=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"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=\"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=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; For example:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"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=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;{\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return ;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#array\" name=\"array\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003EARRAY\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EDeclaring an array\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ewithout specifying any value\u003C\/span\u003E\u0026nbsp;as size of array.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EDeclaring an array taking\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Evariable n\u003C\/span\u003E\u0026nbsp;as size of array.\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003EC\u003C\/span\u003E\u0026nbsp;does not allow a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Evariable length array.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EInitializing\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emore values\u003C\/span\u003E\u0026nbsp;than the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Especified size.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAccessing array elements\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ebeyond the range limits.\u003C\/span\u003E\u0026nbsp;\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EArray elements are to be used from\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E0 to maxsize-1.\u0026nbsp;\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"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=\"color: lime;\"\u003Egarbage value is printed.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EDeclaring array of\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Etype void.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Ch2\u003E\n\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E\u003C\/h2\u003E\n\u003Ch2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#string\" name=\"string\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ESTRING\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003ENot allocating sufficient space in a character array to store the\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;null character\u003C\/span\u003E\u0026nbsp;that terminates a string.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EPrinting a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E\"string\"\u003C\/span\u003E\u0026nbsp;that does not contain\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eterminating null character.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"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=\"color: lime;\"\u003Elow memory address\u003C\/span\u003E\u0026nbsp;are reserved for special purposes such as operating system interrupt handlers. So\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;\"access violation\"\u003C\/span\u003E\u0026nbsp;occurs.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u0026nbsp;Not including the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E\u0026lt;string.h\u0026gt;\u003C\/span\u003E\u0026nbsp;header when\u0026nbsp;using string functions from the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Estring-handling library.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003ENot appending a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eterminating null character\u003C\/span\u003E\u0026nbsp;to the first argument of a\u003Cspan style=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#pointer\" name=\"pointer\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ECOMMON PROGRAMMING ERRORS - POINTERS\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EThe\u0026nbsp;\u003Cspan style=\"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=\"color: lime;\"\u003E\u0026nbsp;*\u003C\/span\u003E\u0026nbsp;prefixed to the name. Eg:\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eint *x,*y;\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"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=\"color: lime;\"\u003Efatal execution time error,\u003C\/span\u003E\u0026nbsp;or it could accidently\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emodify important data\u003C\/span\u003E\u0026nbsp;and allow the program to run to completion with\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;incorrect result.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EBeing unaware that a \u0026nbsp;function is expecting pointers as arguments for\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Epass-by-reference\u003C\/span\u003E\u0026nbsp;and\u003Cspan style=\"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=\"color: lime;\"\u003Ememory-access\u003C\/span\u003E\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eviolation\u003C\/span\u003E\u0026nbsp;or\u0026nbsp;\u003Cspan style=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003ESubtracting\u003C\/span\u003E\u0026nbsp;or\u0026nbsp;\u003Cspan style=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003ERunning off\u003C\/span\u003E\u0026nbsp;either end of an array when using\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Epointer arithmetic.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"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=\"color: lime;\"\u003Evoid *\u003C\/span\u003E\u0026nbsp;is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Esyntax error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EDereferencing\u003C\/span\u003E\u0026nbsp;a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Evoid *\u003C\/span\u003E\u0026nbsp;pointer is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAttempting to\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emodify an array name\u003C\/span\u003E\u0026nbsp;with\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;pointer arithmetic\u003C\/span\u003E\u0026nbsp;is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ecompilation error.\u003C\/span\u003E\u0026nbsp;\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cbr \/\u003E\n\u003Ch2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#structure\" name=\"structure\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ESTRUCTURES\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EForgetting the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Esemicolon\u003C\/span\u003E\u0026nbsp;that terminates a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Estructure definition\u003C\/span\u003E\u0026nbsp;is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Esyntax error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAssigning a structure of one type to a structure of different type is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ecompilation error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EInserting\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Espace\u003C\/span\u003E\u0026nbsp;between the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E-\u003C\/span\u003E\u0026nbsp;and\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E\u0026gt;\u003C\/span\u003E\u0026nbsp;components of the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Estructure pointer operator\u003C\/span\u003E\u0026nbsp;is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAttempting to refer to a member of a structure by using only the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emember's name\u003C\/span\u003E\u0026nbsp;is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003ENot using\u003Cspan style=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#file\" name=\"file\"\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Cspan style=\"font-weight: normal;\"\u003EFILE HANDLING\u003C\/span\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EOpening an existing file for\u0026nbsp;\u003Cspan style=\"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=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EForgetting to open a file before attempting to\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ereference\u003C\/span\u003E\u0026nbsp;it in a program is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Elogic error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003Eopening a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Enonexistent file\u003C\/span\u003E\u0026nbsp;for reading is an error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EOpening a file for reading or writing without having been granted the\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;appropriate access rights\u003C\/span\u003E\u0026nbsp;to the file ( this is\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eoperating-system dependent\u003C\/span\u003E) is an error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EOpening a file for writing when\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eno space\u003C\/span\u003E\u0026nbsp;is available is a\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;runtime error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EOpening a file in\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ewrite mode (\"w\")\u003C\/span\u003E\u0026nbsp;when it should be opened in update\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emode (\"r+\")\u003C\/span\u003E\u0026nbsp;causes the contents of the file to be \u003Cspan style=\"color: lime;\"\u003Ediscarded.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#informative\" name=\"informative\" span=\"\" style=\"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=\"text-align: justify;\"\u003E\n\u003Cspan style=\"line-height: 24px;\"\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"},"georss$featurename":{"$t":"United States"},"georss$point":{"$t":"37.09024 -95.712891000000013"},"georss$box":{"$t":"23.559521500000002 -116.36718800000001 50.6209585 -75.058594000000014"}},{"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - POINTERS\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EThe \u003Cspan style=\"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=\"color: lime;\"\u003E *\u003C\/span\u003E prefixed to the name. Eg: \u003Cspan style=\"color: lime;\"\u003Eint *x,*y;\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"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=\"color: lime;\"\u003Efatal execution time error,\u003C\/span\u003E or it could accidently \u003Cspan style=\"color: lime;\"\u003Emodify important data\u003C\/span\u003E and allow the program to run to completion with\u003Cspan style=\"color: lime;\"\u003E incorrect result.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EBeing unaware that a \u0026nbsp;function is expecting pointers as arguments for \u003Cspan style=\"color: lime;\"\u003Epass-by-reference\u003C\/span\u003E and\u003Cspan style=\"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=\"color: lime;\"\u003Ememory-access\u003C\/span\u003E \u003Cspan style=\"color: lime;\"\u003Eviolation\u003C\/span\u003E or \u003Cspan style=\"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=\"text-align: left;\"\u003E\u003Cli style=\"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=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003ESubtracting\u003C\/span\u003E or \u003Cspan style=\"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=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003ERunning off\u003C\/span\u003E either end of an array when using \u003Cspan style=\"color: lime;\"\u003Epointer arithmetic.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EAssigning pointer\u003C\/span\u003E of one type to a pointer of another type if neither is of type \u003Cspan style=\"color: lime;\"\u003Evoid *\u003C\/span\u003E is a \u003Cspan style=\"color: lime;\"\u003Esyntax error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EDereferencing\u003C\/span\u003E a \u003Cspan style=\"color: lime;\"\u003Evoid *\u003C\/span\u003E pointer is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAttempting to \u003Cspan style=\"color: lime;\"\u003Emodify an array name\u003C\/span\u003E with\u003Cspan style=\"color: lime;\"\u003E pointer arithmetic\u003C\/span\u003E is a \u003Cspan style=\"color: lime;\"\u003Ecompilation error.\u003C\/span\u003E\u0026nbsp;\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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":"Array"},{"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 - ARRAY"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - ARRAY\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EDeclaring an array \u003Cspan style=\"color: lime;\"\u003Ewithout specifying any value\u003C\/span\u003E as size of array.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EDeclaring an array taking \u003Cspan style=\"color: lime;\"\u003Evariable n\u003C\/span\u003E as size of array. \u003Cspan style=\"color: lime;\"\u003EC\u003C\/span\u003E does not allow a \u003Cspan style=\"color: lime;\"\u003Evariable length array.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EInitializing \u003Cspan style=\"color: lime;\"\u003Emore values\u003C\/span\u003E than the \u003Cspan style=\"color: lime;\"\u003Especified size.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAccessing array elements \u003Cspan style=\"color: lime;\"\u003Ebeyond the range limits.\u003C\/span\u003E\u0026nbsp;\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EArray elements are to be used from \u003Cspan style=\"color: lime;\"\u003E0 to maxsize-1.\u0026nbsp;\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EC\u003C\/span\u003E does not report any error if user tries to access elements beyond this range but some \u003Cspan style=\"color: lime;\"\u003Egarbage value is printed.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EDeclaring array of \u003Cspan style=\"color: lime;\"\u003Etype void.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cdiv\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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":"functions"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERROR - FUNCTION"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cdiv style=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html\" target=\"_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=\"color: lime;\"\u003Edouble x,y\u003C\/span\u003E instead of \u003Cspan style=\"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=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b); \u0026nbsp;\/\/ error\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return a\/b;\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b)\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"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=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; For example:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; float division(float a, int b)\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;{\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return ;\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;}\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cbr \/\u003E\n\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cdiv\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - CONTROL STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"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=\"mokcode\"\u003E\u003Cspan style=\"color: blue;\"\u003Efor ( a = 4; a \u0026lt;= 10; a++);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u0026nbsp; \u0026nbsp;printf ( \"%d\", a );\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E}\u003C\/span\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\u0026nbsp; \u0026nbsp; 3. \u0026nbsp; Not including curly braces to include if or loop statements.\u003C\/div\u003E\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\u0026nbsp; \u003Cbr \/\u003E\n\u003Cdiv\u003E\u003Cdiv\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - FUNDAMENTALS\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\u003C\/div\u003E\u003Col\u003E\u003Cli\u003ENot putting semicolon after C statements like \u003Ci\u003E\u003Cspan style=\"color: lime;\"\u003Eprintf() \u003C\/span\u003E\u003C\/i\u003Eor\u003Ci\u003E \u003Cspan style=\"color: lime;\"\u003Escanf()\u003C\/span\u003E\u003C\/i\u003E\u003Cspan style=\"color: lime;\"\u003E.\u003C\/span\u003E\u003C\/li\u003E\n\u003Cli\u003ENot including required header files.\u003C\/li\u003E\n\u003Cli\u003E\u003Cspan style=\"color: lime;\"\u003EParenthesis\u003C\/span\u003E not matching in \u003Ci\u003E\u003Cspan style=\"color: lime;\"\u003Eprintf()\u003C\/span\u003E or \u003Cspan style=\"color: lime;\"\u003Escanf().\u003C\/span\u003E\u003C\/i\u003E\u003C\/li\u003E\n\u003Cli\u003ENot including \u003Cspan style=\"color: lime;\"\u003Edouble quotes\u003C\/span\u003E in \u003Cspan style=\"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=\"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=\"color: lime;\"\u003E address of operator\u003C\/span\u003E ( \u0026amp; ) in \u003Ci\u003Escanf().\u003C\/i\u003E\u003C\/li\u003E\n\u003Cli\u003EUsing \u003Cspan style=\"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=\"color: lime;\"\u003Ea\u0026nbsp;+ b \/ 2\u003C\/span\u003E is different from\u003Cspan style=\"color: lime;\"\u003E ( a\u0026nbsp;+ b ) \/ 2.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ol\u003E\u003Cdiv\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}}]}});