I have a string:
B<T>::B() [with T = int]
Is there any way I can get
B<T> [with T = int] from this before run time somehow? :)
EDIT:
Simplifying: Is there any way to get X & Y separately from a static string XY defined as a preprocessor macro in any form before runtime?
...
I have a char * with a date string I wish to parse. In this case a very simple format: 2010-10-28T16:23:31.428226 (common ISO format).
I know with Boost I can parse this, but at a horrible cost. I have to create a string-stream, possibly a string, and then copy data back and forth. Is there any way to parse the char * without allocating...
I did a program in C++ but it does not allow to save on c:\SomeDirectory\afile.txt
I'm using this:
FILE* m_hFile = fopen("c:\\SomeDirectory\\afile.txt", "a+t");
fprintf((FILE *)m_hFile, "testing");
fclose(m_hFile);
Why that? Is there a defined folder I can save in?
...
Hello,
i'm trying to create JNI C++ library that will capture desktop video (frames).
First step is to simply make a screenshot of desktop. Code is :
#include <iostream>
#include <X11/Xlib.h>
using namespace std;
int main()
{
Display *display;
int screen;
Window root;
display = XOpenDisplay(0);
...
Hi,
I want to overload the assignment operator for types like "int", "long" etc. That is, I want to use code like:
class CX {
private:
int data;
...
};
CX obj;
int k;
k = obj; // k should get the value of obj.data
Apparently assignment operators cannot be friend functions. How do I achieve the above?
I maybe missing something ...
Can you tell me what does .time do ? I supose that time is something like a function ,but what does the . operand do ??
Thank you ! :)
...
What defect rate can I expect in a C++ codebase that is written for an embedded processor (DSP), given that there have been no unit tests, no code reviews, no static code analysis, and that compiling the project generates about 1500 warnings. Is 5 defects/100 lines of code a reasonable estimate?
...
Is this a stupid question? Or can I specify g++ to use a program between the preprocessor and compiler?
Alternatively, I know that I can just run the preprocessor on a file (hence all the files). Then I am guessing there is a switch to run only the compiler. So I can manually invoke these two and put my program between. If so, how do I ...
Background:
I have template stream operators (e.g. operator << (ostream &, std::vector <T>)) (that output container elements that may possibly be of some 8-bit integer type, (e.g. unsigned char, int_least8_t, et cetera).
Problem:
Default is that these types are output as char (ASCII).
I only used char (or wchar_t or whatever) for ASCI...
HI
I am a B.E(CS) fresher.I am searching for a job in IT.There are openings for few C++
developers than java developers.Once i get 1-2 years of experience as C++ developer,can
i switch to a java application developer(for survival).
...
Where can I find some tutorial for creating QT applications (with C++)?
How should I start?
...
The below code couldn't pass the compilation, what's the consideration for this compiler error?
template<class T> void f(T t) {};
template<> void f<char>(char c = 'a') {}
Error message: Default arguments are not allowed on an explicit specialization of a function template
...
im having hardtime in memset and memcpy. can somebody trasnlate this for me, or suggestion on how this thing work?
do{
memset(szSpeechBuf, 0x0, sizeof(char)*QSIZE);
if((nBufIter+1)*QSIZE > nRawBufLen)
{
diff = nRawBufLen - (nBufIter)*QSIZE;
if(diff < 0)
{
printf("DetectSpeech() error : timeout!!!");
...
Hi,
Learning static classes, I read some examples and would like to ask whether my opinion is correct:
Menus - MY opinion: is it because I only need one menu and instances of menu are not making sense?
Constant information - MY opinion: I could have simply const variables, right?
Helper methods - MY opinion: it is because they do not be...
Hi there.
I'm writing a 3D grid for my scientific software and I need to iterate through the nodes of the grid to get their coordinates. Instead of holding each node object in the container I'd rather like to just calculate the coordinates on the fly while iterating. The problem is that stl::iterator requires to return reference to a va...
If I have this structure:
namespace A
{
template <Class T>
struct Point
{
Point<T>(T x_, T y_) : x(x_), y(y_) {}
Point<T>() : x(0), y(0) {}
T x;
T y;
}
}
How might I define an object from the Point struct?
I tried:
A::Point point;
but it does not work.
...
Imagine I have 3 rows in a sqlite table.
While reading these 3 rows I also want to insert new rows depending on the values in these 3 rows.
I do a select on these rows and use sqlite3_step function to get each row.
The problem is that sqlite3_step loops through more than 3 times, I think because it also sees the newly inserted rows. S...
Hi All
I am trying to be familiar with the complexity evaluation of algorithms. In general I think that is a good/elegant practice, but in the specific I need it to express time complexity of my C++ code.
I have a small doubt. Suppose I have an algorithm that just reads data from the beginning of a std::vector until the end; then it ...
Hello,
I want to add a QWidget based class(composed by buttons and labels an so on...) to my QGraphicScene scene in a special position and respecting the graphic style of my scene.?
I am using QT 4.7.
...
Hi,
I was wondering is there a component or library like Dozer for C++.
Dozer is a Java Object to Java Object mapper that recursively copies data from one object to another. Typically, these Java Objects will be of different complex types.
Dozer supports simple property mapping, complex type mapping, bi-directional mapping, implicit...