Solved

C++

Posted on 1998-05-06
7
127 Views
Last Modified: 2010-04-10
How do you return a char value into a method function
0
Comment
Question by:c9725458
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

726 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