The exit symbol cannot be found in C ++.

Source: Internet
Author: User

See http://www.gamedev.net/topic/475709-error-c3861-exit-identifier-not-found/


Question:

No
Clue, it seems very wrong that exit wocould not work, but what do I know? I'm new to this. Here's the whole file. It's just
A sample that I found and am trying to get working for practice. # include <stdio. h ># include <sqlite3.h> static int callback (void * notused, int argc, char ** argv, char ** azcolname) {int I;
For (I = 0; I <argc; I ++) {printf ("% s = % s \ n", azcolname [I], argv [I]? Argv [I]: "null");} printf ("\ n"); Return 0;} int main (INT argc, char ** argv) {sqlite3 * dB; char * zerrmsg = 0; int RC; If (
Argc! = 3) {fprintf (stderr, "Usage: % s Database SQL-STATEMENT \ n", argv [0]); exit (1);} rc = sqlite3_open (argv [1], & dB); If (
RC) {fprintf (stderr, "can't open database: % s \ n", sqlite3_errmsg (db); sqlite3_close (db); exit (1 );} rc = sqlite3_exec (dB,
Argv [2], callback, 0, & zerrmsg); If (RC! = Sqlite_ OK) {fprintf (stderr, "SQL error: % s \ n", zerrmsg); sqlite3_free (zerrmsg);} sqlite3_close (db); Return 0 ;}


Answer:

That
Is because exit is in

stdlib.h

Header if you are coding in C, or

cstdlib

And is then named STD: exit if you are using C ++.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.