I just started using Pantheios and it feels really like a great library for logging! Maybe even the greatest one for C++! Congratulations to the author!
However, I could not find neither in the documentation nor in all the forum posts anything about how to include the calling class and the line number in the log.
I'm using be.file as b...
void BinaryTree::InitializeFromFile(string Filename){
ifstream inFile;
inFile.open(Filename, fstream::binary);
if(inFile.fail()){
cout<<"Error in opening file "<<Filename;
return;
}
for(int i=0;i<=255;i++) Freq[i]=0;
char c;
inFile.get(c);
while(!inFile.eof()){
Freq[c] ++;
inFile.get(c);
}
}
HuffmanTree.cpp(...
We are working on Arabic Natural Language Processing project, we have limited our choices to either write the code in Python or C++ (and Boost library). We are thinking of these points:
Python
Slower than C++ (There is ongoing work to make Python faster)
Better UTF8 support
Faster in writing tests and trying different algorithms
C++...
I call C++ function from C# project:
[System.Runtime.InteropServices.DllImport("C.dll")]
public static extern int FillSlist(out string slist);
and then
try
{
FillSlist(out slist);
}
catch
{
}
C++ dll is protected by third-party tool, so some code is being performed before FillSlist is really executed. Something really bad happens...
From the native Win32 API using C++ is there a way to determine whether the window associated with an HWND is still valid?
...
Hi all,
I've got some Asynchronous cleanup activity I need to do as my Qt application is shutting down.
My current approach is to trap the aboutToQuit signal. I launch my Asynchronous behavior, and then the application shuts down. Is there any way to block Qt from shutting down until my asynchronous behavior is complete?
This works on...
[edit] I meant to say "command arguments in compiler configs" . for the title.
I am trying to get into game mods. And I am trying to implement the source sdk. one of the steps is to go into debugging in my compiler configurations and add some data to the command arguments
-dev -sw -game "C:\Program Files (x86)\Steam\steamapps\SourceMod...
Hi,
I'm trying to write a Date class in an attempt to learn C++.
I'm trying to find an algorithm to add or subtract days to a date, where Day starts from 1 and Month starts from 1. It's proving to be very complex, and google doesn't turn up much,
Does anyone know of an algorithm which does this?
...
How to create interface for C++ application with XAML? (I SEARCH FOR SOME APP LIKE EXPRESSION BLEND (OR even beter a plug in for it))
...
I'm trying to build OpenSceneGraph's pdf plugin on a win32 box. The plugin is using cmake's PKG_CHECK_MODULES macro to find cairo and poppler libraries. I don't know how to install these in such a way as to help it find them though.
...
Hello all. I've been learning C++ for quite a while and a thought flashed in my mind to do a very simple game.
What is my first step? Any libraries available?
What books/sites you recommend?
Finally, is c++ ok to start with games programming?
...
Have a look at the following code you are not required to read the whole code just read the code of copy constructor and the main program.
the following statement in the copy constructor
//the statement below should do the shallow copy
ptr[currentsize++]=object.ptr[i];
this statement should do a shallow copy in case of array of ...
I'm getting a little tired of building web applications. Feels like same thing over and over again. Are there any other cool things you can do. I'm maybe getting to start coding in C++.
Any suggestions for tips in that area? Should I delve into Qt or MFC? Any suggestions?
...
Is there an alternative version of std::find_if that returns an iterator over all found elements, instead of just the first one?
Example:
bool IsOdd (int i) {
return ((i % 2) == 1);
}
std::vector<int> v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
v.push_back(4);
std::vector<int>::iterator it = find_if(v.begin(), v.end(), IsOd...
If I have the following Java code:
int[][] readAPuzzle()
{
Scanner input = new Scanner(System.in);
int[][] grid = new int[9][9];
for (int i=0; i<9; i++)
for (int j=0; j<9; j++)
grid[i][j] = input.nextInt();
return grid;
}
public static void main(String[] args) {
// Read a Sudoku puzzle
int[][] gr...
I've seen people do things like....
istringstream ibuf;
if (ibuf >> zork >> iA >> Comma >> iB)
now I guess the value depends on what >>iB exposes but exactly what is that and what does it mean? Does true mean all the ietms were extracted?
Also, after an expression like
ibuf >> zork >> iA >> Comma >> iB;
is there any way to ...
When creating a child process in C++ using Windows API, one can allow inheritance of handles from parent to child. In a Microsoft example "Creating a Child Process with Redirected Input and Output", redirecting a child process' std in/out to pipes created by the parent, it is necessary to allow inheritance for the redirection pipes to be...
Is this scenario even possible?
class Base
{
int someBaseMemer;
};
template<class T>
class Derived : public T
{
int someNonBaseMemer;
Derived(T* baseInstance);
};
Goal:
Base* pBase = new Base();
pBase->someBaseMemer = 123; // Some value set
Derived<Base>* pDerived = new Derived<Base>(pBase);
The value of pDerived->someBase...
I am referencing a DLL in my C# project as follows:
[DllImport("FeeCalculation.dll", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Ansi)]
public static extern void FeeCalculation(string cin, string cout, string flimit,
string frate, string fwindow, string fincrement, string fbird,
...
Hi there, anyone can explain me, why this parts of code are acting differently?
while((c = fread(buf, sizeof(char), 1, f)) != 0);
{
if(write(t, buf, c) < 0)
{
return E_MSGSEND;
}
}
/////////////////////////////////////
do
{
c = fread(buf, sizeof(char), 1, f);
if(write(t, buf, c) < 0)
{
retu...