---
title: "How to create Constructor in C  ?"  
description: "How to create Constructor in C  ?"  
author: "Aaron Douglas"  
published: 2013-06-13  
updated: 2013-06-14  
canonical: https://www.mindstick.com/forum/1063/how-to-create-constructor-in-c  
category: "visual c++"  
tags: ["visual c++"]  
reading_time: 1 minute  

---

# How to create Constructor in C  ?

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances),\
I'm [beginner](https://www.mindstick.com/forum/23159/need-beginner-project-ideas) in [language](https://www.mindstick.com/startup/28/preply-the-fast-growing-platform-transforming-language-learning) ([C++](https://www.mindstick.com/blog/745/array-in-c-plus-plus)) . I'm have created some example for [learning](https://www.mindstick.com/articles/126221/instructional-design-for-elearning-why-it-is-so-important) point of view. Can you tell me how to create constructor in C++ language? Please provide me line of code.\
Your help is greatly appreciated.

## Replies

### Reply by AVADHESH PATEL

Try as following:\

```
class myclass{public:myclass( );};myclass::myclass( ){cout<<"In constructor\n";}
```


---

Original Source: https://www.mindstick.com/forum/1063/how-to-create-constructor-in-c

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
