answersLogoWhite

0

User defined data type in c plus plus?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

Use "typedef" : both in C and C++.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: User defined data type in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is string is primitive or user defined data type?

String - is primitive data typestring - is user defined data type


What is data type of class in oops?

user defined


What are user defined data types?

Actually user defined data type made by user like array,structure,union,pointer. the data type which is define by user or programer according to his need is called user define data type and also called the programer define data type........


Which data type can store any data?

There is no such data type. However, when we use user-defined data types of our own type, then that type of data can be stored in a variable. So as a term, you may say that user-defined data type can store any data. As the data-type used in any variable will be depending upon us.


What is the need for operator overloading?

1. Most fundamental data types have pre-defined operators associated with them. For example, the C++ data type int, together with the operators +, -, *, and /, provides an implementation of the mathematical concepts of an integer. To make a user-defined data type as natural as a fundamental data type, the user-defined data type must be associated with the appropriate set of operators. 2. Increases user readabitily.


Is struct is user defined data type?

yes, a structure is a user-made data type so that user can manipulate multiple data types simultaneously. a structure covers up sum limitation of arrays as in it provides heterogenous data type.


Application of array in data structure?

That rather depends on the underlying type. For any given type T, an array of type T is user-defined if T is user-defined, otherwise it is built-in. For example: #include<string> // required to use std::string std::string s[42]; // user-defined array int i[42]; // built-in array Here, s is a user-defined array because std::string is a user-defined type, whereas i is a built-in array because int is a built-in type.


Define objects and show how they act as user defined data type in c plus plus with the help of a programme?

An object is an instance of a class. A class is a data type that combines data and the specific methods that operate upon that data into a self-contained entity. To prove that objects are user-defined types, consider the following: class foo { }; int main() { foo a; foo b; foo c = a + b; // ERROR! } The reason there is an error is because the plus operator (+) only works with primitive data types (integral, arithmetic and built-in data types). foo is neither an integral, arithmetic nor built-in data type, thus the plus operator is not supported. However, if you provide a user-defined plus operator overload (foo::operator+) that accepts a constant reference to a foo object, the code will compile. It's up to you, the class designer, to provide the appropriate implementation.


What does POD mean in slang?

Plain-Old-Data ........usually a built in or user defined type....


What are the two types of conversions for user defined data type?

The two types of convertion areImplicitExplicit


Difference between built in data type and user-defined datatype?

A built in data type is a framework's native data type. By default you'd probably have some built in generic data types, such as integer, string, boolean and so on. In the other hand sometimes you can extend the framework's data types, by programminga user-defined data type. In this data type you have to define it's behaviour and structure, and once defined, you can use it the same way you use the default data types. In PostgreSQL or Oracle, you can define data types. You can read about it on their webs.


What is the need for structure datatype?

A structure is not a data type. We use structures to define new data types (user-defined data types). If we didn't have the ability to create user-defined types we'd be limited solely to the built-in data types and arrays of those types.