Answer to Question #180849 in C++ for Ramakrishna Reddy

Question #180849

Explain with an example how one user defined data type can be converted to a predefined data type. 


1
Expert's answer
2021-04-14T01:05:39-0400

User defined data type:

A data type, which are defined by the user are called the derived data type. It is also called the user defined data type. example

#include <bits/stdc++.h>
using namespace std;
class Test {   
public:
    string test;
    void printname()
    {
        cout << "Test: " << test;
    }
};
int main()
{
      Test test1;   
      test1.test = "Testing done";
      test1.printname();
      return 0;
  }
  
  

Predefined data type:

A fundamental data types are called the predefined data type. Which are directly used to store the values. for example int, char, float etc.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS