简体   繁体   中英

SQLite console appears after running C++ application

my problem is that when I run the main .cpp file the SQLite console appears and waits for commands instead of performing the operations in the code and producing some output. What is the problem? Okay, the code was just a test to make sure everything works:

#include "sqlite3.h"
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
sqlite3 *database;
sqlite3_open("Database.sqlite", &database);
sqlite3_stmt *statement;

if (sqlite3_prepare_v2(database, "CREATE TABLE a (b INTEGER, c INTEGER);", -1, &statement, 0) == SQLITE_OK) {
    int cols = sqlite3_column_count(statement);
    cout << cols;

    int result = sqlite3_step(statement);
}
return 0;
}

不要在项目中包含sqlite的shell.c。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM