Thread: please annotate these sentences

  1. #1
    Registered User
    Join Date
    Jan 2019
    Posts
    1

    please annotate these sentences

    intXstrLength=String(Xstr).length();

    if(Xstr[XstrLength-1]!='|'){Xstr[XstrLength]='|';

    Xstr[XstrLength+1]='\0';

    waht's
    '|' means? where '|' come from?

    Thanks


  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    36,838
    'A' means the character constant A
    'B' means the character constant B

    So now you know what '|' is.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    576
    '|' is ASCII character 124 Decimal, 7C Hexadecimal.

    It can be used for creating a pipe between two command line apps.

    In this case, without seeing all your code or possible data file data, it might be used as a field separator, in a record in a data file.

    As for "annotating" your code above, you would need to provide more information, and usually a program that can show the context of these lines. Preferably not a huge program.

    Plus, your code appears to be C++, not C. This is a C Programming forum.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Scanf a sentences
    By ncode in forum C Programming
    Replies: 7
    Last Post: 01-24-2012, 09:38 PM
  2. Replies: 9
    Last Post: 11-23-2011, 09:32 PM
  3. Please Help (capitalise sentences)
    By code_lover in forum C Programming
    Replies: 21
    Last Post: 08-21-2011, 08:31 AM
  4. Parsing sentences
    By curlious in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-16-2004, 01:20 AM
  5. how to count sentences and words?
    By Ray Thompson in forum C Programming
    Replies: 1
    Last Post: 11-08-2002, 01:42 PM

Tags for this Thread