Thread: Problem passing a pointer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    7
    Thanks alot everyone. I found out what was causing the problem. Thanks for telling me about the toupper(). I'm learnin a little bit more everyday.
    The code I threw up there was just the chunk I had a problem with. It was just a exercise I thought up to use pointers. I found what was causing the problems one was the switchchar[1], should of been switchchar[2](thank you!). The other was my original code I used cin.getline to get first and second, instead of cin>>. For some reason out of the function first was second and second had nothing in it. Thank you again everyone you guys have been a great help.

  2. #2
    Useless Apprentice ryan_germain's Avatar
    Join Date
    Jun 2004
    Posts
    76
    Quote Originally Posted by bigbadbowlindud
    The other was my original code I used cin.getline to get first and second, instead of cin>>. For some reason out of the function first was second and second had nothing in it.
    I think (not too sure, maybe someone can correct this), but getline will leave the newline character at the end...so when you called getline or cin again, all you read was the newline? Can someone tell me is this is right????

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A problem with pointer initialization
    By zyklon in forum C Programming
    Replies: 5
    Last Post: 01-17-2009, 12:42 PM
  2. Problems with passing an array of structures by pointer
    By raptor1770 in forum C Programming
    Replies: 9
    Last Post: 11-29-2008, 11:01 AM
  3. Replies: 5
    Last Post: 08-12-2007, 05:26 PM
  4. Passing a pointer as a reference
    By hYph3n in forum C++ Programming
    Replies: 5
    Last Post: 10-04-2006, 01:45 PM
  5. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM