Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus bios bsod computer crash desktop drive driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory missing monitor motherboard network printer problem ram random registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Unterminated character string

Reply  
Thread Tools
2203's Avatar
Computer Specs
Junior Member with 2 posts.
 
Join Date: Nov 2009
Experience: Computer Illiterate
13-Nov-2009, 01:58 PM #1
Unterminated character string
Hi, I am new to programming in C++, and I am getting a unterminated character string in my line of code. Can anyone help me out and tell me what the problem is? I appreciate the help!


## Good researchers collect demographic data anonymously.
## GetNIMHDemographics(gSubNum, gWin, "igt-demographics.txt")

## Give instructions; wait for them to hit a key,
SetText(gInstructions "You are about to take part in an experiment that involves gambling with play money. You will start with a $2000 loan. On each trial, you will select a card from one of four decks, by clicking with the mouse. After you select each card, you will be given a reward and possibly be required to pay a penalty. Your goal is to maximize the profit on your loan, and you may choose from any deck at any time to do so.

Do you have any questions?


Press any key to begin.")
Show(gInstructions)
Draw()
WaitForAnyKeyPress()
Hide(gInstructions)
Draw()
bpmurray's Avatar
Member with 104 posts.
 
Join Date: Jun 2003
Location: Ireland
Experience: Advanced
15-Nov-2009, 09:21 AM #2
You can't continue a string over multiple lines
You have:
Code:
SetText(gInstructions "You are about to take part in an experiment that involves gambling with play money. You will start with a $2000 loan. On each trial, you will select a card from one of four decks, by clicking with the mouse. After you select each card, you will be given a reward and possibly be required to pay a penalty. Your goal is to maximize the profit on your loan, and you may choose from any deck at any time to do so.

Do you have any questions?


Press any key to begin.")
There are a bunch of new lines in your string, and that's not allowed. Use the "\n" (backslash n) newline notation instead:

Code:
SetText(gInstructions "You are about to take part in an experiment that involves gambling with play money. You will start with a $2000 loan. On each trial, you will select a card from one of four decks, by clicking with the mouse. After you select each card, you will be given a reward and possibly be required to pay a penalty. Your goal is to maximize the profit on your loan, and you may choose from any deck at any time to do so.\n\nDo you have any questions?\n\n\nPress any key to begin.")
Of course, you should really split this message up over a number of lines.
2203's Avatar
Computer Specs
Junior Member with 2 posts.
 
Join Date: Nov 2009
Experience: Computer Illiterate
16-Nov-2009, 01:44 PM #3
Thanks very much! That was very helpful.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:19 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.