Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ sqlite open file in other directory

int main(){
  
  sqlite3* db; // Pointer to SQLite connection
  const char* sqlFilename = "C:/Users/database.sqlite";//the path to your sqlite
  int error = sqlite3_open(sqlFilename, &db); //opening conection
  if(error){
      //if error then display error and close conection
      std::cout << "DB Open Error: " << sqlite3_errmsg(db) << std::endl;
      sqlite3_close(db);
      return 1;
  }
  else {
      std::cout << "Opened Database Successfully!" << std::endl;
  }
  return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ make constructor fails if bad argument 
Cpp :: screen record ios simulator 
Cpp :: filling dynamic array with a specific value in c++ 
Cpp :: C++ add value to exception message 
Cpp :: perulangan c++ 
Cpp :: exit() in c++ 
Cpp :: modf() c++ 
Cpp :: c++ overwrite file 
Cpp :: temporary mobile number 
Cpp :: extern __shared__ memory 
Cpp :: max element in vector c++ 
Cpp :: capacity() in c++ 
Cpp :: c++ remove space from string 
Cpp :: n queens c++ 
Cpp :: c++ find sum of vector 
Cpp :: user input c++ 
Cpp :: how to delete a certain amount of numbers of the same value in multiset c++ 
Cpp :: cpp take lambda as parameter 
Cpp :: c++ round number up 
Cpp :: how to get input in cpp 
Cpp :: minimum spanning trees c++ 
Cpp :: g++ optimization flags 
Cpp :: c++ print vector without loop 
Cpp :: character array to string c++ stl 
Cpp :: factorial in c++ 
Cpp :: check if file is empty c++ 
Cpp :: random number generator c++ between 0 and 1 
Cpp :: min heap and max heap using priority queue 
Cpp :: find primes in a range in c++ 
Cpp :: minimum value in array using c++ 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =