Jump to content

  • Log In with Google      Sign In   
  • Create Account

Stickmunkee

Member Since 17 Jan 2013
Offline Last Active Feb 12 2013 06:17 PM

Topics I've Started

Simple Vector list problem

07 February 2013 - 12:38 PM

I'm beginning in C++ and am working my way through a book to learn it. I've come across a simple problem I don't know how to fix.

The program is a simple system where you type in the title of a game, which the computer adds to a list and then shows you the list.

The issue is: If you enter a title like "Unreal Tournament" it treats "Unreal" and "Tournament" as separate titles like this:

Unreal

 

Tournament

.

I've tried different ways of using endl and \n in different locations, but that seems to bear no effect.

My question is, still using vectors, how can I get it to list multi-word titles correctly?

 

A separate issue I'm having is my attempt to add an "erase title" function. How can I get the program to search for a title input by the user and then remove that title?


Error: Expression must be a modifiable lvalue

17 January 2013 - 03:29 PM

I've looked around gamedev some and it seems like there's a really supportive community, so I decided to try getting support on this error I'm getting.

 

I'm learning C++ from a book; I'm just beginning in it, so this is a really simple program. The idea is: the user enters a number, which the computer guesses at. However, in the section where I'm modifying the ai's guessing logic, I'm getting an error I can't find a good way to get around. I included a picture of the code and error. When I hover my mouse over the variables "guess" in the arithmetic within the 'if' blocks, it says: "Error: Expression must be a modifiable lvalue"

 

I would really appreciate an explanation of what that means and maybe a suggestion to fix it.

Many thanks in advance for helpful replies.


PARTNERS