Time difference in C++
Hi guys, Does anyone know how to calculate time difference in C++ in miliseconds? I used difftime (time.h) but it's not enough precision for what I'm trying to measure. Thanks, in advance. Alejo ...
Hi guys, Does anyone know how to calculate time difference in C++ in miliseconds? I used difftime (time.h) but it's not enough precision for what I'm trying to measure. Thanks, in advance. Alejo ...
I keep seeing people say that exceptions are slow but I never see any proof. So instead of asking if they are I will ask how do exceptions work behind the scene so I can make a decisions of when to use them and if they are slow. From what I know exceptions are the same thing as doing a bunch of return but it also checks when it needs to...
I was thinking along the lines of using typeid() but I don't know how to ask if that type is a subclass of another class (which, by the way, is abstract) Edit: I should definitely mention the language, C++ ...
I have a few things that I cannot find a good way to perform in Visual Studio: Pre-build step invokes a code generator that generates some source files which are later compiled. This can be solved to a limited extent by adding blank files to the project (which are later replaced with real generated files), but it does not work if I don...
What is the difference between CString in vc6 and vc7? ...
I was of the opinion that virtualization doesnt work in the super class constructor as per the design of OOP. For example, consider the following C# code. using System; namespace Problem { public class BaseClass { public BaseClass() { Console.WriteLine("Hello, World!"); this.PrintRandom...
Hi *, As an c# developer I'm used to run through constructors: class Test { public Test() { DoSomething(); } public Test(int count) : this() { DoSomethingWithCount(count); } public Test(int count, string name) : this(count) { DoSomethingWithName(name); } } Is there a way to do this in...
I am working on a C++ project and I noticed that we have a number of warnings about unused parameters. What effect could it have if these warnings are ignored? ...
Hi all.. Been thinking, what's the difference between declaring a variable with [] or * ? The way I see it: char *str = new char[100]; char str2[] = "Hi world!"; .. should be the main difference, though Im unsure if you can do something like char *str = "Hi all"; .. since the pointer should the reference to a static member, which ...
Can anyone point me in the right direction how to configure Visual Studio 2005 with our C++ console project how we can include a 'File Version' in the details section of the file properties. I've tried resource files without any luck. This is with a C++ project just for clarification, and big thank you for the guys you responded with C#...
I've just done a test with bitfields, and the results are surprising me. class test1 { public: bool test_a:1; bool test_b:1; bool test_c:1; bool test_d:1; bool test_e:1; bool test_f:1; bool test_g:1; bool test_h:1; }; class test2 { public: int test_a:1; int test_b:1; int test_c:1; int te...
I know this may be simple but being C++ I doubt it will be. How do I convert a string in the form 01/01/2008 to a date so I can manipulate it? I am happy to break the string into the day month year constituents. Also happy if solution is windows only. ...
I'm currently working on a pet project and need to do C++ development on Windows, Mac, Linux, and Solaris, and I've narrowed it down to Netbeans and Eclipse, so I was wonderig which is more solid as a C++ editor. I just need solid editing, good autocompletion for templated code ad external libraries, and project file management, the buil...
How much do using smart pointers, particularly boost::shared_ptr cost more compared to bare pointers in terms of time and memory? Is using bare pointers better for performance intensive parts of gaming/embedded systems? Would you recommend using bare pointers or smart pointers for performance intensive components? ...
Is it better to have all the private members, then all the protected ones, then all the public ones? Or the reverse? Or should there be multiple private, protected and public labels so that the operations can be kept separate from the constructors and so on? What issues should I take into account when making this decision? ...
With a vector defined as std::vector<std::string>, Wondering why the following is valid: if ( vecMetaData[0] != "Some string" ) { ... But not this: switch ( vecMetaData[1] ) { ... Visual studio complains : error C2450: switch expression of type 'std::basic_string<_Elem,_Traits,_Ax>' is illegal 1> with 1> [ 1...
Hi All, Can I integrate my exsisting C++ library in an iPhone application? Thanks & Regards Khushi ...
Thanks for your support, but will it(integration of exsisting C++ library with iPhone application) effect my application at the time of submision to Apple Store? Are there any chances of disapproval of application from Apple Store? Thanks & Regards Khushi ...
I'm working with SQL Native Client 9 in a C++ application that communicates with SQL Server 2000. I'm working on debugging things right now but something I've noticed that bothers me (mostly because it's creating significant clutter) is that sqlnclir.rll is being loaded and unloaded continuously and the following lines are being spammed...
I'm using the following code to try to read the results of a df command in Linux using popen. #include <iostream> // file and std I/O functions int main(int argc, char** argv) { FILE* fp; char * buffer; long bufSize; size_t ret_code; fp = popen("df", "r"); if(fp == NULL) { // head off errors reading the results...