I figured it out. When the server accepted a connection from a client, I hadn't WSAAsyncSelect() ed this new socket yet. I added this line and it works fine now.
Type: Posts; User: addle_brains
I figured it out. When the server accepted a connection from a client, I hadn't WSAAsyncSelect() ed this new socket yet. I added this line and it works fine now.
Can you post the code of your structure declaration and definition.
I tested the program running the server and clients from different computers, the problem still persists. I've followed everything properly (in terms of initialising winsock and everything) as far as...
Right, fixed that. Do you know why the message never gets sent to the client?
Hey guys, having a bit of a problem with Winsock in C++. I have a suspicion what the problem is but I thought I'd get a second opinion. I'm creating a simple chat program just to practice my windows...
Hey, I'm currently looking into steganography and I decided to create a C++ program to hide a txt file in a bmp file as a little learning experience. All this code runs fine, my problem is occurs...
Cool, I think I'll just have a unix version and a windows version. Use whichever one is relevant.
Read in a character from cin without echoing it or waiting for eof.
I have implemented it with conio.h, but i'd much rather an ANSI way if there is one.
Is there a real way of achieving this? I want to make the program more portable. If there isn't, what's the windows implementation?
Oh! is that what the random garbage was that whole time? Because I hadn't specified what I wanted in that memory space yet?
Edit: All fixed! :) It seems it was an issue with window line-endings...
I'm sorry, there's just quite a bit of code here and I'm not quite sure how to explain how it all works. I'm sure you don't want me to post the entire program??? I've fixed the above algorith to work...
It gave me a bit of junk output.
Did you mean something like this?
unsigned x = 0;
unsigned y = 0;
while (in.get(passTo)) {
terrainArray->Put(x, y, passTo);
if (passTo == '\n') {
y++;
It doesn't screw up the line output, but it does throw the 2d array off. If there aren't the same amount of characters in the file as there are in the array (longest line * number of lines) then it...
Well, it seems to output correctly, even if there are inconsistent line lengths. I think this is because of the nature of the Array2D class. The class basically created an array of size width *...
Hm, well, I fixed it. Not entirely sure but I think it's ok. I added 1 to the value of width. This caused the function to reprint the final character in the text file. So, as long as the text file...
Okay, wait, that's not what I want. It's output the file properly, just not the right amount of characters.
Thankyou!!!!!!
That worked. Also I had to change that inbedded for loop part, because it didn't work.
Is there a way to leave out line endings during get, because it's working, only the map is...
Okay, i've changed that to
if (entry.size() > longFile.size()) {
longFile = entry;
}
Regardless, that didn't fix the problem.
Ok. I managed to narrow it down where it's happening to a constructor:
#include <fstream>
#include <string>
#include <vector>
#include <iostream>
#include "terrain.h"
I may have figured it out. Is there a way to reset the "read position" in a file so to the start?
I have tried to output data in some of the copying processes. It's not actually outputing anything.
Well, the function which draws the terrain onto the screen takes a pointer to the screen class. I removed the pointer, and the output is different but still messed up. The problem is that I can think...
I was able to add debugging code to verify that the file is being read correctly. I tried adding a sort of std::cout << charBeingProcessed << std::endl; kind ok stuff. Nothing was output.
Okay. I'm currently designing a small little "maze" game. Heading towards an ascii dungeon game, but keeping it simple for now. Simply, the program so far is meant to read in a text file containing...