Export a .sqllite file in C/C++ (on windows)
It is possible to move a .sqllite file somewhere while not corrupting it in C or C++? Somewhere could be another folder or something. If so could you give me some tips/pointers. ...
It is possible to move a .sqllite file somewhere while not corrupting it in C or C++? Somewhere could be another folder or something. If so could you give me some tips/pointers. ...
Hello, Looking through OMake documentation it seems whenever sources from subdirectories are used - they are always compiled into static libraries first. Is this always necessary? Can I compile and link everything without building the libs? I've been trying to write OMakefiles for this but with no success. Example dir structure: mypr...
Suppose Y is a derived class from class X and X declares foo to be virtual. Suppose y is of type (Y*). Then ((X*)y)->foo() will execute the Y version of foo(), but ((X)*y).foo() will execute the X version. Can you tell me why polymorphism does not apply in the dereferenced case? I would expect either syntax would yield the Y version of f...
I got a strange compilation error when I followed the MSDN document to use CA2W to convert big5 strings to unicode strings in Visual Studio 2005. This is the code I wrote: #include <string> #include <atldef.h> #include <atlconv.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string chineseInBig5 = "\xA4\xA4\xA4\x...
Lets say that input from the user is a decimal number, ex. 5.2155 (having 4 decimal digits). It can be stored freely (int,double) etc. Is there any clever (or very simple) way to find out how many decimals the number has? (kinda like the question how do you find that a number is even or odd by masking last bit). ...
Is their any way I can target a certain file and be able to receive all changes that are made to it? Such as a file called Names.txt. Could I watch that file for names added? and then write them to the console? The example code with not compile in Dev-C++ 4.9.9.2 #include <windows.h> #include <stdlib.h> #include <stdio.h> #include <tc...
Hey guys, I'm writing a word wrap function to format console text in C++. My problem is either A) I don't understand exactly what std::string::iterators do, or B) one of my iterators is not being set properly. Can anyone shed some light on the reason this code fails? by the way: sorry if this goes into too much detail. I'm not sure if m...
Is there such a thing as a jagged array in C or C++? When I compile this: int jagged[][] = { {0,1}, {1,2,3} }; I get this error: error: declaration of `jagged' as multidimensional array must have bounds for all dimensions except the first ...
I want to write a word to each line before all the words. DATA.txt { ie. Hello my name is steven ie. 1.hello 1.my 1.name 1.is 1.steven } IN FILE I/O to put the number 1 and a dot before all the words in the beginning of the line Ok i want it to find the string then ut the certain text "...
i am using C++ say i want to store 40 records( usrnames) i will simply use array if i want to store 40000 records ( usrnames) . i will search it sequentially which data structure should i use? any thoughts? ...
Many times I have problems with Buffer Overflow. int y[10][10][10]; ... y[0][15][3] = 8; How can I prevent this problem? Is there any good tool that can help me? ...
I'm trying to build Amaya. When the build failed with error: expected unqualified-id before ‘(’ token I ran g++ with only the preprocessor (replacing the -c option with -E) on the file that failed to compile to see what was going on. This produced an 80,000 line file, showing me that 'Blue' had been replaced by (2 << 8), which clear...
In C++ it is possible to create a struct: struct MyStruct { ... } And also possible to do the following: typedef struct { ... } MyStruct; And yet as far as I can tell, no discernable difference between the two. Which is preferable? Why do both ways exist if there is no difference? Is one better than the other in style or re...
Is that even possible ? Lets say that the code has a lot of scanf lines. Instead of manually running and adding values by hand when debugging, is it possible to "feed" stdin with data so that when the scanf starts reading, it will read the inputted data without any need to interact with the terminal. ...
I've been learning C++ for about a month now, and as I've written programs I've noticed that enabling the user to cancel their input (during a cin loop) is a pain. For example, a program that takes user input and stores it in a vector would have a cin loop like this. vector<int>reftest; int number; cout << "Input numbers for...
I am a beginer in programming. unfortunately I have a project in c++ that I don't know its problem. the program is a little long: #include <iostream.h> #include <conio.h> #include <stdio.h> #include <stdlib.h> #include <alloc.h> #include <time.h> #include <math.h> #include "vdsim.h" void gen01dat( long, int); void cnv_encd(int g[], long...
I was thinking about this when I ran into a problem using std::ofstream. My thinking is that since std::ifstream, it wouldn't support random access. Rather, it would just start at the beginning and stream by until you get to the part you want. Is this just quick so we don't notice? And I'm pretty sure FILE* supports random access so th...
I have neglected my programming skills since i left school and now i want to start a few things that are running around in my head. Qt would be the toolkit for me to use but i am undecided if i should use Python (looks to me like the easier to learn with a few general ideas about programming) or C++ (the thing to use with Qt). In my scho...
This my chat mixed with threads to run server and chat at same time. The problem is when I send a message to the chat lets say "Hello" as the first message, and "bye" as the second Output will go: Hello Byelo And some extra characters that I do not want there how to remove my chat's extra characters and letters? C++ I tried cout<<"Me...
Suppose I have a C++ macro CATCH to replace the catch statement and that macro receive as parameter a variable-declaration regular expression, like <type_name> [*] <var_name> or something like that. Is there a way to recognize those "fields" and use them in the macro definition? For instance: #define CATCH(var_declaration) <var_type> <...