Thread: § Character

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    15

    § Character

    I am trying to use the special character § when printing a text string in my program. I pass the § character to a CString variable but when it comes print time text types out and after it prints the § character it does a return and continues with the sentence. Every place in my code that i have the § character it prints but the does a return after I print it. Here is my code:

    Code:
    	CString csNoticeText;
    	short iState;
    	double dFinancedAmount;
    	
    	m_dbFirst.Get_Field(&iState, _Policy_ApplicableLaw_State);
    	m_dbFirst.Get_Field(&iSubLien, _Loan_OtherCollateral_Lien_Subordinate);
    	m_dbFirst.Get_Field(&dFinancedAmount, _Loan_Financed_Amount);
    
    	if (iState == 49 && iSubLien && dFinancedAmount <= 25000)
    	{
    		csNoticeText =  "Notice to Married Applicants: Wisc. Statutes §766.59 or a court decree under Wisc. Statutues §766.70 adversely affects the interest of the lender.";
    		m_dbFirst.Set_Field( csNoticeText, _Application_MarriedNotice_Text);
    	}
    	else
    		m_dbFirst.Del_Field( _Application_MarriedNotice_Text);
    The results this will give me at print time is:
    Notice to Married Applicants: Wisc. Statutes §
    766.59 or a court decree under Wisc. Statutues §
    766.70 adversely affects the interest of the lender.


    I am hoping there is a character or something I can put in front of the § character to make C++ realize i want it treated as text. If I am trying to do something impossible and that is communicated to me that is appreciated too. Thanks for any help and those that took the time to look. Have a good day.

    ~Beaner~

  2. #2
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Try putting this in front of the character: "\"

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Figure out its octal equivalent and put it in the string:
    Code:
    printf("Octal 315 is \315\n");
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    It's not a standard character, so how you represent it in your code depends on how (or even if) your current display device is even capable of displaying that character.
    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.

  5. #5
    Registered User
    Join Date
    Mar 2005
    Posts
    15
    Thanks for your help everyone! I will see if I can use the information you sent me to get it working. Thanks again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 10-07-2008, 06:19 PM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. syntax error when defining vectors
    By starkhorn in forum C++ Programming
    Replies: 5
    Last Post: 09-22-2004, 12:46 PM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM