LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-01-2012, 12:35 AM   #1
errigour
Member
 
Registered: May 2009
Posts: 366

Rep: Reputation: 6
C programming and receiving information with a server


I am having problems working with arrays and receiving data from remote hosts. I was hoping someone might be able to help me with my problem. Basically I just need help with comparing arrays that I have received from a remote host using the function recv. I recv data but I cant compare data with strings because when I receive data I either receive 11 characters or 0. Is there a way to tell exactly what someone typed even after receiving 11 characters of a string that was only 5 characters long? How can I compare "n" with "???????????" (notice there are 11 questions marks there because I recv 11 bytes every tie I receive data).
 
Old 05-01-2012, 12:48 AM   #2
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
I think I resolved my problem. Maybe someone can tell me if I did.
does recv always receive two extra bytes because my computer said recv
received 3 bytes when I only entered one. I'm hoping that the 2 extra bytes
are permanent and not variablistik.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket programming: sending and receiving msgs back and forth ninja123 Linux - Networking 4 05-20-2010 06:30 AM
Programming using my WiFi information flogeros Programming 2 06-06-2009 03:05 PM
Programming using my WiFi information flogeros Linux - Newbie 1 06-06-2009 11:42 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration