Closed Thread
Results 1 to 2 of 2

Thread: [C] Comparison problem

  1. #1
    Alhazred is offline Learning Programmer
    Join Date
    Jul 2007
    Location
    Italy
    Posts
    96
    Rep Power
    0

    [C] Comparison problem

    My client-server software should simulate an email service on a local machine.
    Send, receive, delete functions works properly, now I have to implement the login service.
    - Once the server is started, the function "InizializzaUtenti" create a list of users loaded from a text file "utenti.txt", then waits the client.
    - The client, with the function "LogIn", sends a message to the server that contains username, password and a service code to request the login service (4)
    - The server receive correctly the message and starts the function "LogIn" thet manage that service.

    Problem
    - Inside the server function "LogIn" the comparison between user and pass received from the client and those loaded from the text file do not work properly.

    I think there should be a problem with line feed at the end of strings, but I can't solve the question. Is that the matter? Can you help me with the problem?

    This is the essential code to menage the login service, I deleted everything else since it works and could confuse reading the code:
    - http://lacasa.altervista.org/software/Server.c
    - http://lacasa.altervista.org/software/Client.c
    - http://lacasa.altervista.org/software/utenti.txt

    txt file must be inside the folder where server process starts.
    txt file structure is:
    - line 1 -> username1
    - line 2 -> password1
    - line 3 -> username2
    - line 4 -> password2
    ... and so on

    To see the code you have to copy the url and paste inside the browsers address bar.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Alhazred is offline Learning Programmer
    Join Date
    Jul 2007
    Location
    Italy
    Posts
    96
    Rep Power
    0
    Problem found... as I thought it was a problem with CR and LF.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. String comparison
    By Slammerek in forum Python
    Replies: 5
    Last Post: 08-21-2011, 11:16 AM
  2. job productivity comparison?
    By ahmed in forum The Lounge
    Replies: 7
    Last Post: 12-09-2010, 02:10 AM
  3. MD5 Checksum comparison asp.net vb
    By Ray2000 in forum Visual Basic Programming
    Replies: 1
    Last Post: 04-07-2010, 01:28 PM
  4. C++ Comparison Algorithm
    By QuackWare in forum Classes and Code Snippets
    Replies: 0
    Last Post: 02-02-2010, 06:19 PM
  5. Comparison of languages
    By WingedPanther in forum General Programming
    Replies: 1
    Last Post: 06-02-2009, 10:20 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts