Thanks for the help =). I really was over thinking it.
Type: Posts; User: Homunculus
Thanks for the help =). I really was over thinking it.
Already did that. It works. The problem is after I sort values[] I will lose the information on which byte had that particular frequency. I could then make the array 2d where I store in...
Write now I am writing code to do Huffman-Coding. It's more of a programming exercise for myself since I haven't done any in a long time. I understand with just 256 values (maximum) performance is...
I have a list of 256 numbers that can range in value up to 256. Each of these numbers are associated to another value so I thought std;:map would be great until I realized there is no function for...
I want to make a generic singleton class which I can create a is-a relationship with.
Looking around a bit I found something like this:
template <class T> Singleton{
protected:
I don't care so much about getting it to work as understanding why it doesn't work. What exactly is wrong about it? I don't see it.
I'm thinking it might be something here that is the problem. Depending on the way I initialize stuff I am getting different results and I'm not sure why. I simply hardcoded a tree to test it.
...
Just messing around and refreshing on C++ and I happen to run into a little problem.
template <class T> class TraverseTree{
public:
TraverseTree();
~TraverseTree();
I've managed to load an image and texture map it. I am now trying to rotate this object. When I rotate it, it looks funny and I'm not sure why.
Here are the relevant lines of code:
void...
It's in the same file.
I get the following errors when I try to compile:
thread.c: In function ‘peerFunc’:
thread.c:102:2: error: ‘PeerArgs’ undeclared (first use in this function)
thread.c:102:2: note: each...
So, if my server turns off the connection properly while the client is currently blocking on recv, recv will return 0? but if the connection were to just suddenly terminate it returns -1? I've been...
So, I wrote a small server program where when I run it I specify a file in the command line arguments... then when a client connects to that server the server starts sending the file to the client.
...
I'm learning socket programming in C. I'm learning from beej's guide at the moment but I wrote a program to display ip's but when I did it, it displayed each 3 times. I'm not sure why... but then I...
I did... then changed it to input[0]=0
I'm not trying to concatenate strings via the + operator... I was just describing the expected outputed from some of the debugging I was doing. Basically it works normally except for that exact...
Well, I have a bizarre error. It works now except that it prints out "Input:" twice. I tried putting a previous printf() call before that one to see if it would print "Input"+"mynewprintfmsg"+"Input"...
I want to know how I can check if a message was too long and truncated or what when I read in a string. If I do:
fgets(iname,MAX_NLEN,stdin);
or something similar it just truncates my string...
Will programs built with win32 api run on 64bit windows too?
Yeah, I think you're right. After having troubles loading in my bitmap data, I went and checked out what you were saying:
cout << fHeader.bfType << endl;
cout << fHeader.bfSize <<...
I figured it out. Turned out by fileheader and infoheader were both 2 bytes too big for some reason, so I changed
fread(&fHeader,sizeof(FILEHEADER),1,fp) to...
I'm trying to load a bitmap and getting weird results when checking what I've loaded into my structures. First I'll show my code:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
...
I am trying to implement the shunting yard algorithm for a graphing calculator that I'd like to make. I've managed before to get it to solve basic equations that don't use braces, or trigonometric...
This shouldn't be to hard, atleast I wouldn't think. I created new project of type Win32 Consol... thing is, I can't do anything that I wanted to do to make it look nice. Such as...
ok =P, I was just thinking more than one tutorial would be necessary... I do have some questions.. I use dev-cpp and when i try to compile there example source I get a whole bunch of Linker Errors....