how do I compare two strings C++ ?

Sharky Forums


Results 1 to 2 of 2

Thread: how do I compare two strings C++ ?

  1. #1
    Great White Shark rimmerchant's Avatar
    Join Date
    Apr 2003
    Posts
    8,983

    how do I compare two strings C++ ?

    I use fgets to get a 10char name from a file
    and store it in a string array.


    and then I use a CIN input to get a 10 char string array


    when I use
    strcmp (string1, string2)
    it would not get a match even though
    KEN is read in from file

    and KEN is type in for the CIN >> input
    C2D Q6600 @ 3.2 ghz, Enermax Liberty 620watt PSU, Gigabyte GA-965PDS3 mobo, 4x2gb OCZ DDR2 800mhz, 2x OCZ vertex 60gb Raid0 + 1TB + 320gb HD, SB Xi-Fi Extreme Gamer, 16x DVDRW Liteon, Logitech Cordless MX3100 desktop w MX1000 mouse + G9 laser mouse, Logitech cordless rumblepad 2, Sennheiser HDR100 wireless headset, ATI Remote Wonder II, Logitech QuickCamPro 9000, Eyefinity Triple 24" Widescrn LCD + ATI 5870, Win 7 ultimate

  2. #2
    Ultra Great White Shark!! richardginn's Avatar
    Join Date
    Feb 2001
    Posts
    16,118
    www.myeducational plan.com-come see my plan to fix the USA educational system. I hope this is sig legal. Major Site Design Update on July 18, 2006. On June 18, 2009 passed the 10,000 post mark. December 24, 2009: Major Theme change and more....

Posting Permissions

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