My program allows a server and a client to chat over a socket. Currently I have to wait for one of them to type a message and press enter, before a message from the other person can be received.
...
Type: Posts; User: SneakySnake
My program allows a server and a client to chat over a socket. Currently I have to wait for one of them to type a message and press enter, before a message from the other person can be received.
...
Thanks! Got it working
Yes, the '-w' is essential. What command would you recommend to extract the number from the string?
I'm trying to get the number out of the argv[1] string.
argv[1] = -w50
line of code I'm using:
sscanf(argv[1], "%d", &columnWidth);
Jim can you show me an example of what such a line would look like? Scanning for 4 words in the string?
I input a line from a file, into a string called line. I then want to scan it to get all the individual parts of it, but I'm unsure of how to do that in c++.
Here's my code:
getline (myfile,...
Ah yes, fixed that.
I'm not familiar with the std::getline way. What would the code look like for that?
thank you.
This is what I'm using now: is this the best way to do it? ( it seems to be working fine)
int main()
{
char marks[15];
I'm trying to get string input from the keyboard for my assignment. For my assignment the user can input 1 of 3 things (there's no menu system to determine which - i have to be able to tell what they...
Thanks a ton!
I'm trying to write a program that wraps words to the next line if there isn't room for them in the current column. I have a function I've written but it doesn't work (apparently strcmp() only works...
Hi, I'm having trouble with an assignment I'm doing. My code is split across 3 files. My header, main, and functions, so I'll post all three.
Header: cA6_proto.h
#define MaxLineSize 100...
thanks a ton. I was messing around with sscanf() but didn't really wrap my head around it.
My string input can either be "-c123" or "-c 123".
What's the best way to scan the string to get the number out?
Hi, I'm trying to write a program that takes a text file as an output, and prints the text of that file to a column size defined by the user.
Here's my printing loop so far, when I run it, it just...
that cleared everything up, thanks a lot!
Oh ok, sorry, I'm only first semester of first year. My mistake:
here is my current code (all other files (header, functions) haven't changed:
#include"cA5_Proto.h"
int main(int argc,...
Thank you again for the help! upon further investigation it appears that my error is at the malloc() line:
Should my fileData after i allocate memory, be equal to fileLength?
I put in a print...
I made my program better, here's the new code:
cA5_Proto.h:
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <Windows.h>
thanks a ton, that helps a lot.
I do have a bunch of libraries included, I just didn't paste them into the code window, the libraries I have are (which are in my header file, my main includes the...
Hi, this is my first post, I'm having a lot of trouble with a C assignment that i have.
I have to get input from a binary file, get the size of that file using a function getSmallFileLength, then...