Search:

Type: Posts; User: SneakySnake

Search: Search took 0.01 seconds.

  1. Is there a simple way to have instant communication in a TCP/IP chat program?

    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.
    ...
  2. Replies
    5
    Views
    694

    Thanks! Got it working

    Thanks! Got it working
  3. Replies
    5
    Views
    694

    Yes, the '-w' is essential. What command would...

    Yes, the '-w' is essential. What command would you recommend to extract the number from the string?
  4. Replies
    5
    Views
    694

    sscanf() issue

    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);
  5. Jim can you show me an example of what such a...

    Jim can you show me an example of what such a line would look like? Scanning for 4 words in the string?
  6. Easiest way to scan string to parse out it's parts?

    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,...
  7. Replies
    5
    Views
    3,527

    Ah yes, fixed that. I'm not familiar with the...

    Ah yes, fixed that.

    I'm not familiar with the std::getline way. What would the code look like for that?
  8. Replies
    5
    Views
    3,527

    thank you. This is what I'm using now: is...

    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];
  9. Replies
    5
    Views
    3,527

    Getting string input from keyboard.

    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...
  10. Thanks a ton!

    Thanks a ton!
  11. Wrapping words during printf from a string so words are never broken apart

    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...
  12. Printing from an opened file character by character

    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...
  13. Replies
    2
    Views
    1,311

    thanks a ton. I was messing around with sscanf()...

    thanks a ton. I was messing around with sscanf() but didn't really wrap my head around it.
  14. Replies
    2
    Views
    1,311

    Best way to scan string for a number?

    My string input can either be "-c123" or "-c 123".

    What's the best way to scan the string to get the number out?
  15. Printing individual characters from fgets using an array

    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...
  16. that cleared everything up, thanks a lot!

    that cleared everything up, thanks a lot!
  17. Oh ok, sorry, I'm only first semester of first...

    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,...
  18. Thank you again for the help! upon further...

    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...
  19. I made my program better, here's the new code: ...

    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>
  20. thanks a ton, that helps a lot. I do have a...

    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...
  21. Get input from a binary file, allocate memory, and fprintf() the file

    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...
Results 1 to 21 of 21