Solved

C++

Posted on 1998-05-06
7
128 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

717 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