User Profile

Collapse

Profile Sidebar

Collapse
rohdej
rohdej
Last Activity: Aug 29 '08, 03:41 PM
Joined: Mar 31 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • rohdej
    replied to Converting an Input String to a Variable Name
    in C
    Thanks. That works just fine. I had been a little confused about pointers to start with, and going through this process actually helped me master pointer operations. I'm using 24 different possible instances of the same class for comparison, so I had to assign each one a string to hold the name (as well as pass each name to the constructor), then use "if-elseif-else" statements to compare with user input. So, a little tedious, but it's...
    See more | Go to post

    Leave a comment:


  • rohdej
    replied to Help, am getting this error C2784 message
    in C
    Considering this is almost exactly the same as the last post, I will pretty much just copy and paste my last reply, with only a few changes:

    You may want to use:
    Code:
    using namespace std;
    ...because it reduces the number of lines of code and is a more general statement. But beyond this, your code will still fail. The only problem with your code, really, is that you declared the variable "operation" as a char. ...
    See more | Go to post

    Leave a comment:


  • rohdej
    replied to error C2065
    in C
    Considering the error statement, you definitely need to use the above mentioned solution:
    Code:
    using namespace std;
    But beyond this, your code will still fail. The only problem with your code, really, is that you declared the variable "operation" as a char. When you do this, you're getting only the character representation of '1', '2', '3', or '4' as input from the user, and therefore when the program is instructed which operation...
    See more | Go to post

    Leave a comment:


  • rohdej
    started a topic Converting an Input String to a Variable Name
    in C

    Converting an Input String to a Variable Name

    Hello -

    I have been all over the web and found a few posts that are somewhat related to what I'm trying to do, but none that provided me a concise answer.

    I want to prompt the user to input the name of a structure in my program. I want to then be able to manipulate that structure in my program.

    For example:

    Code:
    #include <iostream>
    #include <string>
    using
    ...
    See more | Go to post
No activity results to display
Show More
Working...