My code basically is to list ASCII codepoints of a string that is input, my following code is simple, here:
#include <iostream>
#include <string.h>
using namespace std;
int main() {
char str[20];
int result[20];
cin >> str;
for(int i = 0; i != strlen(str); i++) {
result[i] = (int)i;
}
for(int i = 0; ...
Hello,
i need to write an web crawler and i need need which is best language for performance like memory and performance ..
Edit: Original title was "which language is optimized for speed and perfomance c++ or C#"
...
Suppose I have a class MyClass to which I want to add certain 'observer' behavior. Then I could define the class like this:
class MyClass : public IObserver
{
...
};
Now suppose this this 'observer' functionality is not directly related to the class, but to data members stored in the class. E.g. a data member points to another class...
I'm using sqlite3_bind_text to bind text parameters to my queries, with the SQLITE_STATIC flag, since I know the text pointer remains valid at least up until the query is executed.
Recently I've made changes so that the queries are executed in the transaction mode (many such queries in a single transaction). Should the text buffer remai...
Suppose I have built a lot of dlls from a certain revision of the svn repository. (It might by any revisioning system)
I am able to create a resource file containing an entry that denotes the revision number.
Can I link that resource file into the dll's I have already built? Some sort of editbin or the like?
...
I want to add a series of strings to a combo box using std::for_each. The objects are of type Category and I need to call GetName on them. How can I achieve this with boost::bind?
const std::vector<Category> &categories = /**/;
std::for_each(categories.begin(), categories.end(), boost::bind(&CComboBox::AddString, &comboBox, _1);
The c...
hi guys, i'd like to know if there a way to get atof continue converting to number even if there are non valid charcters in the way
for example let say i have string "444-3-3-33"
i want to covert it to a double a=4443333
(and keep the string as it was)
happy to get any suggestions or an alternative way
thanks!
...
Greetings everyone. I am working on a small project and need your help. Here are the details:
My project is in VC++ 2008
I need to store some critical resource files bundles with my project exe in encrypted form
While running the exe, I want to decrypt and use these files on the fly (without storing decrypted files in temp location)
Th...
I will be very grateful, if somebody can actually explain what exactly my compiler does when I press button BUILD, and compiler begins to compile all my .h and .cpp files how exactly this process is going on(what do I have inside object file?), why do I ask such question? I'm trying to understand what does it mean "minimize compilation d...
looking for RESTful engine in c++
...
Possible Duplicate:
Where can I learn more about C++0x?
I am fairly familiar with C++03 but I still need to come to terms with C++0x so I would like to read some fairly digestible information on C++0x.
I have looked at the Wikipedia but I am on the look out for something that is more readable. So is there a book or series of ...
Or, "how do Russians throw exceptions?"
The definition of std::exception is:
namespace std {
class exception {
public:
exception() throw();
exception(const exception&) throw();
exception& operator=(const exception&) throw();
virtual ~exception() throw();
virtual const char* what() const throw();
};
}
A popul...
I develop and run C++ program in Eclipse CDT on Linux.
The problem is that Eclipse CDT does't show any runtime error message (e.g. segmentation fault) in console, while I can get such error message when running program directly with command line.
...
why if we have pure virtual assignment operator in a base class, then we implement that operator on the derived class, it give linker error on the base class?
currently I only have the following explanation on http://support.microsoft.com/kb/130486 , it said that the behavior is by design since normal inheritance rules does not apply.
...
In C++, I can statically initialize an array, e.g.:
int a[] = { 1, 2, 3 };
Is there an easy way to initialize a dynamically-allocated array to a set of immediate values?
int *p = new int[3];
p = { 1, 2, 3 }; // syntax error
...or do I absolutely have to copy these values manually?
...
Source code analysis and exploration tools for C and C++ seem to be sorely lacking.
Are there any tools which I can use to gather information about C and/or C++ source files? cscope does part of what I would need, Doxygen looks closer.
At a minimum list of all function, callers, callees, variable references etc.
Perhaps Doxygen's xml ...
My code does not compile. Below is my code
template <typename T>
class TemplateClass
{
const T constMember;
public:
TemplateClass()
{
constMember = T();
}
};
int main()
{
TemplateClass <int> obj;
}
I get this error :
error: uninitialized member 'TemplateClass<int>::constMember' with 'const' type 'c...
I'm having a pointer problem that I can't seem to figure out. It seems like I've used pointers in this way a 1000 times so I'm not quite sure what is going on here. I have the following code:
int iRetVal;
CycleCountOrder* cycleOrder = NULL;
CycleCountLineItem* cycleLine = NULL;
iRetVal = m_CycleCount.GetCCOrderLine(pOneLocation.szO...
I have a QGraphicsView and a slide show of QGraphicsScenes, at the moment when the user switches to the next slide I just change the Scene that the View is looking at and it changes instantly to reflect that.
What I would like to do it create some transition effects, such as the rotating cube or the slide in/out.
However looking at the...
I have the code below:
class A
{
};
class B: public virtual A
{
public:
B()
{
cerr << "B()";
}
B(const A& a)
{
cerr << "B(const A&)";
}
};
class C: public B
{
};
int main(int argc, char **argv)
{
B *b = new B(C());
}
To my surprise B(const A& a) isn't called. Why is that?
...