Solved

C++

Posted on 1998-05-06
7
124 Views
Last Modified: 2010-04-10
How do you return a char value into a method function
0
Comment
Question by:c9725458
  • 4
  • 3
7 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 50 total points
ID: 1173551
I'm not sure what you mean?

How do you return a char value FROM a function?  That woud be

char ClassName::FunctionName()
{
   char ReturnValue = 'a';

   return ReturnValue;
};
0
 
LVL 22

Expert Comment

by:nietod
ID: 1173552
How do you PASS a char value into a function?  That woud be

void ClassName::FunctionName(char CharParameter)
{
   cout << CharParameter;
};

If you mean something else, can you try to reword the question?
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1173553
I was going to answer, but nietod got in first.

You question is not well worded .. please explain a little better what it is you are wanting to do.  the phrase 'return a value into a function' doesn't make sense .. you return values FROM a function -or- you pass them INTO a function
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:nietod
ID: 1173554
Roger, this time you can't complain that I just beat you to it.  I answered yesterday.  
No word on wethor or not I answered the right questions though.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1173555
I know you were well ahead of me on this .. but I hadn't read noticed your comment about the other possible interpretation (only the proposed answer) .. and was just about to submit the sme thing as a comment when I noticed you'd actually addressed both ways that we could have interpretted this.  Of course, neither is probably what the poster wanted :-)

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1173556
Looks like this IS what he wanted to know.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1173557
Lucky guess?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now