473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

checking if the value is an number or a character, is there such function?

I am looking for a C++ method that will tell me if the value returned
is a int, double, floeat, etc. Is there such a method in C++?

Thanks folks

Oct 13 '05 #1
5 1157
returned from where?

Oct 13 '05 #2

"jalkadir" <ja******@gosonic.ca> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I am looking for a C++ method that will tell me if the value returned
is a int, double, floeat, etc. Is there such a method in C++?


Certainly. Whatever return type you define.

int i()
{
return 0; /* returns a type 'int' object */
}

double d()
{
return 0; /* returns a type 'double' object */
}
-Mike
Oct 13 '05 #3
well I think he wants to define how the returned type is , as Mike said
the type of returned data is clear in C++ , cause it is the exact type
that you have declared when you were declaring the function. But if you
are using VC++ or something else that contain datatypes that can accept
different types like we have in delphi , I think i have read something
like this in C++ but not sure about it . but give sizeof() a try , it
might help you .

Shahab.

Oct 13 '05 #4
ben
jalkadir wrote:
I am looking for a C++ method that will tell me if the value returned
is a int, double, floeat, etc. Is there such a method in C++?

Thanks folks


The return type of any function can be and is determined at compile
time. Even by looking at the function declaration can tell you what type
does the function return.

Perhaps you are talking about something else, things like type reflection?

If the function you are expecting does exist, what would you think it
would look like? Is the following the example of what you are looking for:

int add(int a, int b);

string rettype = get_return_type("add"); // returns "int"

Ben

Oct 13 '05 #5
An**********@gmail.com wrote:
returned from where?

Please read my .sig.
Brian
--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.
Oct 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: tornado | last post by:
Hi all, I am pretty new to PHP. I was reading PHP manual and trying out the example from 2nd chapter (A simple Tutorial). When i try to print the variable as given in the example it returns...
67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
5
by: Sue | last post by:
As soon as a character is entered in the first field of a new record, the number of records shown in the navigation buttons increases by 1 and the new record button becomes enabled. In the...
2
by: Clint Olsen | last post by:
Hello: I posted a thread on comp.programming awhile back asking about an algorithm I implemented on square root. The idea was to use the square root of a prime number as a convenient way to get...
1
by: lkrubner | last post by:
this is a function that someone has up on www.php.net: function seemsUTF8($Str) { // bmorel at ssi dot fr //17-Feb-2004 01:22 //Here is an improved version of that function, compatible with...
4
by: Patient Guy | last post by:
Does anyone have any coding rules they follow when doing argument checking? When arguments fail during check, do you return from the call with an ambiguous return value, or do you throw...
15
by: H. | last post by:
What's the easiest way to check if an argument entered at the command line is a number? I know that one way would be to treat the argument as a character string, and then manually check each...
7
by: Jay | last post by:
I want to check if a character is a decimal digit (0-9). I've found Char.IsNumber() and Char.IsDigit() but couldn't work out from Help how they differ. Also, do I need to worry about how digits...
10
by: Brent | last post by:
I have a list of company names (say, IBM, Corning, General Motors, and another 5,000 of them). If I take a body of text, a news article, for instance, and I want to see which company names...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.