There is a rectangular grid of coins, with heads being represented by the value 1 and tails being represented by the value 0. You represent this using a 2D integer array table (between 1 to 10 rows/columns, inclusive).
In each move, you choose any single cell (R, C) in the grid (R-th row, C-th column) and flip the coins in all cells (r,...
How do you count unicode characters in a UTF-8 file in C++? Perhaps if someone would be so kind to show me a "stand alone" method, or alternatively, a short example using http://icu-project.org/index.html.
EDIT: An important caveat is that I need to build counts of each character, so it's not like I'm counting the total number of charac...
Is there a difference between:
operator delete(some_pointer);
and
delete some_pointer;
and if so what is the difference and where one should use one and where the other version of this operator?
Thanks.
...
Anyone know where I can get a list of CL.exe exit codes and what they mean? Google is not my friend on this and the particular code I'm getting (4) also doesn't seem to get any hits.
Although the meaning to code 4 would be nice, I'd prefer a site that actually lists them all.
...
It appears that some electronics have programmed within them what's called an "alarm subsystem". What exactly is this subsystem? what does it tie to? what does it do? Is it known by any other name? If I were to program one, in general what would be the pseudo logic of it? Please don't mind going heavy on the details as I'm really new to ...
I using MSXML4 to generate a XML.
I'm trying to set the encoding value to UTF-8.
Here is my code:
const _bstr_t k_XML_Tag_Name ("xml");
const _bstr_t k_Processing_Tag_Name ("version=\"1.0\" encoding=\"utf-8\"");
MSXML2::IXMLDOMProcessingInstructionPtr pProccessingInstruction = m_pXmlDoc->createProcessingInstruction(k_XML_Tag_Name,...
I'm looking for an API that works similarly to GDI+. I need to be able to fill paths, with a solid, gradient etc fill. I found the AGG library but I don't like its loose design. I like creating a Graphics object and having it append to my screen bitmap or off screen bitmap. Are their libraries that function this way and are cross platfor...
so I have VideoEncoder.h with such code
/*
FFmpeg simple Encoder
*/
#ifndef __VIDEO_ENCODER_H__
#define __VIDEO_ENCODER_H__
#include "ffmpegInclude.h"
#include <Windows.h>
#include <string>
class VideoEncoder
{
private:
// output file name
std::string outputFilename;
// output format.
AVOutputFormat *pOutFormat;
...
I think it's unreasonable for a library to require preprocessing of my source code with a special tool. That said, several have recommended the Qt library to me for cross platform GUI development.
How usable is Qt without the preprocessing step?
EDIT: Okay people; I'm not meaning this question as a rip on Qt -- too many Qt fanboys are ...
I am trying to overload my operators its really just a class that holds arithmetic functions and a sequence of array variables.
But when i am overloading my (*) multiplication operator i get this error:
binary '*' : no global operator found which takes type 'statistician'
(or there is no acceptable conversion)
This happens when...
I have this kinda of input:
x4.9
x.25
C400
What is the best way to drop the first char and convert to float?
...
E.g:
isValidCppIdentifier("_foo") // returns true
isValidCppIdentifier("9bar") // returns false
isValidCppIdentifier("var'") // returns false
I wrote some quick code but it fails:
my regex is "[a-zA-Z_$][a-zA-Z0-9_$]*"
and I simply do regex.IsMatch(inputString).
Thanks..
...
SOLVED. See below for the corrections (labeled FIXED).
I'm having trouble creating a shared library using gcc.
I created a little sample project that closely mirrors the structure of the actual project I'm working on. I've made it available as a tar.gz archive here:
http://209.59.216.197/libtest.tar.gz
FIXED: I've made the fixed v...
I am a fresh college grad student that just started my job. In my ramp up period, I need to learn a lot of product code. There are some design docs but they do not help much.
Can you provide some general techniques to browse and understand huge product code (specifically C++)?
...
Hello,
I'm developing an application targeted to a POCKET PC 2003 (Windows CE 4.2) device using C++ and native WINAPI (i.e. no MFC or the like). In it I have a single-line edit control which part of the main window (not a dialog); hence the normal behaviour of Windows when pressing ENTER is to do nothing but beep.
I've subclassed the w...
Hi everyone! I'm trying to write a linked queue in C++, but I'm failing so far. I've created 2 files by now: my main.cpp and box.h. When trying to use my box, I receive the following message:
Description Resource Path Location Type
conversion from ‘Box*’ to
non-scalar type ‘Box’
requested main.cpp /QueueApplicati...
When generating a MSVS Solution file with SCONS, I end up with a flat list of projects in a solution file. Is there any way to specify solution filters through the solution builder? It does not appear so from the API or documentation.
...
Hello All
I have a question which I cannot seem to fathom out, as fairly newish to c++. I have a class, in which a set of variables are declared in the .h file and then initialised in the .cpp file. These same variables are used by a set of 3 other classes - and the compiler has them as out of scope. I am not sure how to link the classes...
My application is a vector drawing application. It works with OpenGL. I will be modifying it to instead use the Cairo 2D graphics library. The issue is with zooming. With openGL camera and scale factor sort of work like this:
float scalediv = Current_Scene().camera.ScaleFactor / 2.0f;
float cameraX = GetCameraX();
float cameraY = Get...
Any reason for that, what is .cc for?
...