C Programming Syntax Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies example of syntax error in programming of this site About Us Learn more about Stack Overflow the company
Syntax Error In Program Saplsfes
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges syntax error in program saplstrd Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a
Syntax Error In Program Sapms380
minute: Sign up Syntax error in C program up vote 1 down vote favorite #include < stdio.h > int main() { char *s; s=call(); printf(s); } char* call() { return("hello"); } Why these code not working. It's generating an error. How do I make it work? c share|improve this question edited Jul 8 '11 at 11:48 phihag 138k33261316 asked Jul 8 '11 example of syntax error in c programming at 11:44 niko 4,396195595 What error are you getting? A compiler error? A runtime error? What is the message? –Oliver Charlesworth Jul 8 '11 at 11:44 conflicting types for all this is the error message i see. and why did the question go -1 ? Is the question wrong? –niko Jul 8 '11 at 11:47 sorry guys please excuse for the question.sometimes we dont get the answer even though we know what we are doing.sorry but my problem is solved thank you all. –niko Jul 8 '11 at 11:52 thanks to the one who upvoted my question.and i request if the question is too sily you can downvote i agree with you. –niko Jul 8 '11 at 11:53 1 Probably got down-voted because people don't like guessing. The exact error message given (by the compiler?) is kind of vital, and you didn't bother to supply it. –T.E.D. Jul 8 '11 at 11:54 | show 1 more comment 1 Answer 1 active oldest votes up vote 2 down vote accepted Two things: You can't put s
be written in a particular programming language. For compiled languages, syntax errors are detected at compile-time. A program will not compile until all syntax errors are corrected. For interpreted
Logic Error
languages, however, a syntax error may be detected during program execution, and an
Syntax Error Example
interpreter's error messages might not differentiate syntax errors from errors of other kinds. Unfortunately there is some disagreement as to just syntax error grammar what errors are "syntax errors". For example, some would say that the use of an uninitialized variable's value in Java code is a syntax error, but many others would disagree[1][2] and would classify this http://stackoverflow.com/questions/6623910/syntax-error-in-c-program as a (static) semantic error. In 8-bit home computers that used BASIC interpreter as their primary user interface, the SYNTAX ERROR error message became somewhat notorious, as this was the response to any command or user input the interpreter couldn't parse. A syntax error may also occur when an invalid equation is entered into a calculator. This can be caused, for instance, by opening brackets without closing them, https://en.wikipedia.org/wiki/Syntax_error or less commonly, entering several decimal points in one number. In Java the following is a syntactically correct statement: System.out.println("Hello World"); while the following is not: System.out.println(Hello World); The second example would theoretically print the variable Hello World instead of the words Hello World. However, a variable in Java cannot have a space in between, so the syntactically correct line would be System.out.println(Hello_World). A compiler will flag a syntax error when given source code that does not meet the requirements of the language grammar. Type errors (such as an attempt to apply the ++ increment operator to a boolean variable in Java) and undeclared variable errors are sometimes considered to be syntax errors when they are detected at compile-time. However, it is common to classify such errors as (static) semantic errors instead.[2][3][4] See also[edit] Tag soup References[edit] ^ Issue of syntax or semantics? ^ a b Semantic Errors in Java ^ Aho, Alfred V.; Monica S. Lam; Ravi Sethi; Jeffrey D. Ullman (2007). Compilers: Principles, Techniques, and Tools (2nd ed.). Addison Wesley. ISBN0-321-48681-1. Section 4.1.3: Syntax Error Handling, pp.194–195. ^ Louden, Kenneth C. (1997). Compiler Construction: Principles and Practice. Brooks/Cole. ISBN981-243-694-4. Exercise 1.3, pp.27–28. This computer-programming-related article is a stub. You ca
Practice Problems Quizzes Resources Source Code Source Code Snippets C and C++ Tips Finding a Job References Function Reference Syntax Reference Programming FAQ http://www.cprogramming.com/reference/preprocessor/error.html Getting Help Message Board Email About Us #error #error "This code should not compile" The #error macro allows you to make compilation fail and issue a statement that will appear in the list of compilation errors. It is most useful when combined with #if/#elif/#else to fail compilation if some condition is not true. For example: #ifndef __unix__ syntax error // __unix__ is typically defined when targetting Unix #error "Only Unix is supported" #endif Related C preprocessor tutorial Want to become a C++ programmer? The Cprogramming.com ebook, Jumping into C++, will walk you through it, step-by-step. Get Jumping into C++ today! Popular pages Exactly how to get started with C++ (or C) today C Tutorial C++ Tutorial syntax error in 5 ways you can learn to program faster The 5 Most Common Problems New Programmers Face How to set up a compiler 8 Common programming Mistakes What is C++11? How to make a game in 48 hours Recent additions How to create a shared library on Linux with GCC - December 30, 2011 Enum classes and nullptr in C++11 - November 27, 2011 Learn about The Hash Table - November 20, 2011 Rvalue References and Move Semantics in C++11 - November 13, 2011 C and C++ for Java Programmers - November 5, 2011 A Gentle Introduction to C++ IO Streams - October 10, 2011 Custom Search Advertising | Privacy policy | Copyright © 1997-2011 Cprogramming.com. All rights reserved. | webmaster@cprogramming.com Popular pages C Tutorial Exactly how to get started with C++ (or C) today 5 ways you can learn to program faster C++ Tutorial The 5 Most Common Problems New Programmers Face How to make a game in 48 hours 8 Common Programming Mistakes What is C++11? Image credits