c++

Rule Based Design

I will regularly read some discrete states, and applying some rules to differences in states I will report some errors. Rules can be changed in time. What are best-practices to solve such a problem? Thanks. ...

C++ input string contain ASCII 26(Substitute) character. How to get rid of it ?

Here's my code. Purpose is to input a Vector of Student class, contain name and homework grades. istream& input(istream& is, student& s){ is.clear(); cout << "Enter student name: "; getline(is,s.name); grade(is,s.homework); return is; } istream& grade(istream& is, vector<double>& homework){ if(is){ homew...

Are stdin, stdout, and stderr Files?

Someone told me that whenever a C++ program is run three files STDIN, STDOUT and STDERR are opened and he gave this link in his support.. http://tldp.org/LDP/abs/html/io-redirection.html But I am confused weather these streams are actually Files? Can anyone clarify? ...

What are the free online certifcations available for Computer Science engineering students?

Hi friends, I would like to know about free online certifcations available for UG students in Computer Science engineering and can help in adding weight to the resume. I know there are many certifications from microsoft and Sun etc! But I cant afford them right now. Thnks in advance ...

surprising constructors for a class!

Hi, What is the problem here in this code? It gives segmentation fault. I found value of size in vector (int *a) is no more 3. How is this? #include <iostream> using namespace std; class vector { int *v; int size; public: vector(int m) { v = new int[size = m]; for(int i=0; i<size; i++) v[i] = ...

File open problem with many process in C

Hi Everyone , Iam working in c++ .i have an problem while run an application ,which have my dll within it ,My dll code is suitable to application (needed process).i wrote a log file (xml file) throughout application using fopen within all function(dll source) ,here i receive exception like "cannot access the file ,due to using by anot...

C++ Overloading the + operator results in error

I have tried to overload the "+" operator for my class: Vector operator+( const Vector& a, const Vector& b ); However,it tells me: vector.h(12): error C2804: binary 'operator +' has too many parameters I really don't get it. Please help me ...

What's the point of this kind of macros?

#define NAME(x) TEXT(x) #define TEXT(quote) __TEXT(quote) // r_winnt #define __TEXT(quote) quote // r_winnt The above is from winNT.h, isn't NAME("Virtual Cam") the same as "Virtual Cam",what's the point to use this macro? ...

How to log all commands run By system() System Call

Hi, I am trying to debug a C++ application which invokes many command line applications such as grep, etc through a the system() system call. I need to see all the commands the application is executing through the system() call. I tried to view these commands by enabling history and view the .history file. But these commands are not ex...

What are the major difference between C# and C++?

Possible Duplicate: Differences between C++ and C#/.Net I'm looking for things like: C# can use strings for case statements whereas C++ can only use integers. C# can only inherit from one class and multiple interfaces. What are some other differences? This seems like I should have found this question in SO but I couldn't....

What's the functioning scope of an critical section locker in c++?

// locks a critical section, and unlocks it automatically // when the lock goes out of scope CAutoLock(CCritSec * plock) The above is from wxutil.h, does it lock the access of different process , or just locks different threads in the same process? ...

easy graphic for C++

What is the easiest framework/IDE fulfilling all following criteria? If such thing does not exist, what is the nearest? compiles C++ installs in full without problems runs under Windows or Linux (1 of those is enough) allows to write text to terminal and simultaneously draw graphics Hello World is short, about 10 lines for code drawing...

C++ - basic Qt question

Hello! Do I have any simple way to have context menu items, that aren't highlighted when mouse goes over them (using Qt)? I want to make simple context menu with various item groups such as | Group1 | ----- | DoSomething | DoSomethingWow | DoSomethingCool | | Group2 | ------ | DoSomethingCoolHuh and I want Group1 and Group...

What's the difference of CSource and CSourceStream in directshow?

These two classes looks similar to me, can you remind me the great difference between these two classes so that I can judge which class a specific interface belongs to without refering to the document?? ...

How to copy text file in C or C++?

When trying to copy a text file A to another file B, there may have several methods: 1) byte by byte 2) word by word 3) line by line which one is more efficient? ...

Are there specific defines of linuxthreads and nptl

Hello I hav a programme, which must work differently for linuxthreads and nptl. Are there defines in this libs, that can be used in my programme to detect, is nptl is used or is linuxthreads is? UPDATE1: For runtime there is a getconf GLIBC_LIBPTHREADS, but what for compile-time? ...

OpenGL: Is it acceptable to work with textures like 2500*2500 pixels?

Hi, The title says it all. Of course the texture will not be completely visible on the screen. And I can make it always draw just the visible part (With glTexCoord2f and then glVertex2f). (It is the big "level"-image, which I have to move around for a sliding camera). Notice this rendering has to be real-time in my game (game is written...

Using Struct Stat()

I'm trying to figure out how exactly to use stat() to capture information about a file. What I need is to be able to print several fields of information about a file. So.. #include <iostream> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> using namespace std; int main() { struct stat buf; stat("file",...

How to make a program that automatically synchronizes

Hey i am hoping to write a program where the program automatically just copy pastes all my dad's documents from D:\office folder. So whenever I plug-in my pen-drive , the program silently copies all documents inside my pen-drive. Also all files should be pasted to a hidden folder in the pen-drive (so it remains private) . Synchronizatio...

Fastest JSON reader/writer for C++

I need C++ json parser & writer. Speed and reliability is very critical, I don't care if interface is nice or not, its Boost based or not, even C parser is also fine (if its considerably faster than C++ ones). If somebody has experience with speed of available JSON parsers, please advice. ...