3
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by JeffGrigg
0

return() returns void (returns control back to the caller) , while return 0 returns a value, the integer 0....

For example, a function to calculate after-tax-pay might take be called by another function. e.g. getEmployeeInfo() may supply our calculatePay() method with the paramaters payrate (int), and taxband (char), do some processing, and return a figure represnting the after-tax-pay. getEmployeeInfo() is then free to do something with this result i.e. print it to the screen.

In the case of main() returning anything, returns control to the OS. The number can be used to indicate success or failure. E.g a daemon returning on a sever may return a value of -1 to the OS to indicate that it had encountered an error, this could then be noted, and recorded to a log.

0

Wat is a size of string in C++?does string ve specific size...?? like integer.. Float.. Char..?

1

It depends, there are two types of string, a C-style-string (char*) and a c C++ (STL) std:string

A C string is an array of characters sequence terminated with a NULL character ('\0').

C++'s std::string class fixes many of the problems that C-style strings have and can be constructed from a C-style string, and a C-style string can also be obtained from it using *.c_str()

2

i think you getting mistakes somewhere..
return(0) is not existing...
plz chk

What on earth are you talking about? And please stop using "leet speak" like "plz chk" as it makes your (already hard enough to understand) replies unintelligible

Edited by jbennet: n/a

Votes + Comments
Yea; leet speak sux. ;-> (Encouraging proper use of English is a good idea.)
2
  • "retrun" is misspelled; it should be "return".
  • "wats" is misspelled; it should be "What's the" or "What is the".
  • "plz" is misspelled; it should be "Please".
Votes + Comments
:)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.