I'm trying to call a nonmember function of a derived class from a base class, but getting this error:
error: no matching function for call to 'generate_vectorlist(const char&)'
Here's the relevant code snippets from the base class:
//Element.cpp
#include "Vector.h"
...
string outfile;
cin >> outfile;
const char* outfile_name ...
My question is that create a IM software like MSN or Gtalk, to have the basic function using C++.
You can use any technology and libary to do that.
Can someone give me a suggestion?
I add that this not my homework. This
is my job question.
Because I am a fresh man in my
company.
So, they give me some questions to let
...
Hello, all the while, I am using setw for my ANSI text file alignment. Recently, I want to support UTF-8 in my text file. I found out that setw no longer work.
#include <windows.h>
#include <iostream>
// For StringCchLengthW.
#include <Strsafe.h>
#include <fstream>
#include <iomanip>
#include <string>
#include <cassert>
std::string wst...
I see somewhere it metions:
for ( itr = files.begin(); itr < files.end(); ++itr ) // WRONG
for ( itr = files.begin(); itr != files.end(); ++itr ) // ok
Why is the first expression wrong? I always used the first expression, and didn't have any problems.
...
How can I convert a character into an integer value? For example, I've been trying to read "A" as 1, "B" as 2, and so forth. I tried comparing the character to each letter in the alphabet and return the appropriate value.
int intvalue(char letter)
{
if(letter == "A")
return 1;
else if(letter == "B")
return 2;
else if(letter == "...
I have a 3D vector class. The private variables are defined:
union {
struct {
double x;
double y;
double z;
};
double data[3];
};
In implementing operator==, which is faster?
return this->x == v.x
OR
return memcmp(this->data, v.data) == 0;
...
I am trying to write a program to serialize a linked list to a file without using any libraries. My problem is how to add or remove nodes to the serialized structure since I dont have next pointer ? Also how can I avoid fragmentation ?
Thanks & Regards
...
I'm trying to access the object (called a Vector) pointed to by a pointer held in a vector container, but I can't seem to get to it.
Here are the important code snippets:
int main{
Vector<double>* test = new Vector<double>(randvec<double>());
test->save();
cout << Element::vectors[0];
return 0;
}
Where Vector is a templ...
When array is created using 'new' and deleted using 'delete' operator, delete knows the size of array. As mentioned in other SO threads, this size information is stored in metadata.
My question: what exactly is stored in metadata and how much space is needed for that? Is it only the size which is stored in metadata?
...
<Update> As usual for me, the question was a wrong one. The actual question is: why doesn't transform_iterator use the conventional result_of<> metafunction to determine the return type, instead of accessing UnaryFunc::result_type directly. Posted an answer with a work around. </Update>
Specifically, is there a way to make a phoenix ...
Hi
I'm working on an legacy C++ application that runs on rugged business mobile devices made by Intermec. I need to add some functionality and would like to build it using WinForms. The idea is that users would click a button in the old app which would launch a WinForms screen. Then they do some stuff, click OK and are returned to the C...
I am using Visual Studio 2005. I created an MFC based console application named "StdAfx dependancy". The IDE created the following files for me.
Resource.h
StdAfx Dependancy.h
stdafx.h
StdAfx Dependancy.cpp
stdafx.cpp
I added another class CHelper with Helper.h and Helper.cpp as below.
Helper.h:
#pragma once
class CHelper
{
public...
Is there a way to make the MFC app work both ways console as well as Window.
...
i get device insertion and removal notification from WM_DEVICECHANGE
i get the dbcc_name from the DBT_DEVTYP_DEVICEINTERFACE
i get the corresponding drive letter from the DBT_DEVTYP_VOLUME
if i insert the device one by one it works correctly
but if i insert two device at a time i get duplication in drive letters
how can i solve it
...
I need to find the duration of numerous formats of audio and video files, in milliseconds. I've been searching around for a while, but I can't find anything that will let me do this. I'm using C/++ in Linux. Thanks in advance.
...
Basically I want to write an application which would display the current language as a tray icon. Mainly I can code C++ and C#. Guess Google would help me out but I would like to ask it here first, since the community, the knowledge here is something I trust.
(Never wrangled with such parts of the system so far. So that's why I would ...
Hi,
I have a simple struct which i'm using as a key in a std::map
struct PpointKey{
unsigned int xp,yp; //pixel coordinates
unsigned int side;
PpointKey(unsigned xp,unsigned yp,unsigned side=5):xp(xp),yp(yp),side(side)
{}
bool operator==(const PpointKey& other) const{
const ...
I've seen posts talk about what might cause differences between Debug and Release builds, but I don't think anybody has addressed from a development standpoint what is the most efficient way to solve the problem.
The first thing I do when a bug appears in the Release build but not in Debug is I run my program through valgrind in hopes o...
I am having an application which established a socket connection on a port number 5005 with another device(hardware device with a web server).
Now if my hardware device disconnects then i loose connection with the device.
Does this mean that the socket i was
using until now becomes invalid.
Do i get any special message like
null ...
In the wonderful world of C# i can create a memory stream without specifying its size,
write into it and then just take the underlying buffer.
How can i do the same in c++? basicly i need to do:
memory_stream ms(GROW_AS_MUCH_AS_YOU_LIKE);
ms << someLargeObjects << someSmallObjects << someObjectsWhosSizeIDontKnow;
unsigned char* buff...