reference string

This is a discussion on reference string within the C Programming forums, part of the General Programming Boards category; What's a reference string? A string is a sequence of characters. A reference string is a string that points to ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    10

    reference string

    What's a reference string?
    A string is a sequence of characters.

    A reference string is a string that points to something?
    It can point to anything?

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    What is the context?

    A string reference is a C++ term that relates to a variable that is a reference to a string. In this context a reference is like an alias for another variable - it's "another name for the same variable" or "another way to get to the variable".

    The C language doesn't have references, so it's either that you [or someone else] are mixing C and C++ nomenclature, or you the meaning is something else.

    --
    Mats
    Last edited by matsp; 05-14-2009 at 04:52 AM. Reason: Fix typos
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by chocolatecake View Post
    What's a reference string?
    A string is a sequence of characters.

    A reference string is a string that points to something?
    It can point to anything?
    Where did you hear of this thing? I've been studying C for more than a year now and I do not think "reference string" has any particular meaning, but it would be an easy term to create in a discussion of some implementation pattern or algorithm.

    So if you provide a bit of context maybe we can figure it out. [edit] matsp will be correct (I don't know C++).
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    They're probably thinking of a string literal. All you can really do is reference it, since you aren't allowed to change them.


    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    10
    pseudo code:

    ...
    for
    read next element sp of RS.
    ...

    Then instruction:
    The remainder of the program executes a loop, one iteration per element in the reference string RS

  6. #6
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by chocolatecake View Post
    The remainder of the program executes a loop, one iteration per element in the reference string RS
    If this is definitely a C (not C++) program, probably this is a normal "string" with a special descriptive moniker added for the purposes I mentioned earlier (ie, rather than just call it "the string"). If this is pseudo-code description of an algorithm which could be implemented in any language, then that is definitely what's going on.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    To me, that sounds like simply a name for a string, referring to the contents perhaps? What is the purpose of the overall task? Is it perhaps to do with some sort of references (literature, geographic, etc)

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  2. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  3. Replies: 4
    Last Post: 03-03-2006, 01:11 AM
  4. How to: Use OpenGL with Jgrasp
    By Pickels in forum Game Programming
    Replies: 3
    Last Post: 08-30-2005, 10:37 AM
  5. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 02:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21