运行C ++应用程序后出现SQLite控制台

时间:2012-11-09 13:04:45

标签: c++ sqlite

我的问题是,当我运行主.cpp文件时,SQLite控制台出现并等待命令而不是执行代码中的操作并产生一些输出。问题是什么? 好的,代码只是一个测试,以确保一切正常:

#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;
}

1 个答案:

答案 0 :(得分:0)

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

相关问题