# Can't draw a user function

**URL:** <https://root-forum.cern.ch/t/cant-draw-a-user-function/37286>\
**Category:** Newbie\
**Created:** [December 21, 2019, 8:40am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286 "2019-12-21T08:40:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [December 21, 2019, 8:40am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286/1 "2019-12-21T08:40:16Z")

</div>

I tried to do draw my function but it was error.

```auto
{
	Double_t myFunc(Double_t x) {
 	return x*x+x+1.0 ; 
	}

	TF1 *f = new TF1("f", "myFunc(x)", 0, 100);
	f->Draw();
}

```

This is a error.

 ![Screenshot_1](https://root-forum.cern.ch/uploads/default/original/3X/9/c/9cd70229700841547ae01127d38260325776e154.png)  
Who can help me resolve this problem?

* * *

_ROOT Version:_ 5.34/36  
_Platform:_ Windows 10  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 21, 2019, 10:26am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286/2 "2019-12-21T10:26:26Z")

</div>

[TF1](https://root.cern.ch/root/html534/TF1.html)  
[TFormula](https://root.cern.ch/root/html534/TFormula.html)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 6, 2020, 3:39pm UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286/3 "2020-01-06T15:39:53Z")

</div>

try:  
[hammiu.C](https://root-forum.cern.ch/uploads/short-url/u5P63UFfz54aX1nBj6x81hVBF8d.C) (134 Bytes)

---

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [January 7, 2020, 2:12am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286/4 "2020-01-07T02:12:45Z")

</div>

Thank you, everything is good. I didn’t have “void”.

---

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [January 8, 2020, 1:21am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286/5 "2020-01-08T01:21:59Z")

</div>

I have a question. On which IDE do you write code? i write it on Notepad++, but it is not good because some codes are different from C++, for exmaple declare integer parameter Int\_t (in C++ int32\_t).

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 8, 2020, 8:58am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286/6 "2020-01-08T08:58:33Z")

</div>

> [@hammiu](#):
>
> On which IDE do you write code?

I see you are working on Windows 10. I am working on MacOS, so I do know what is the best IDE on Windows. May be @bellenot can give you some advices on that topic.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [January 8, 2020, 9:04am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286/7 "2020-01-08T09:04:39Z")

</div>

I use [VS Code](https://code.visualstudio.com/) as code editor, otherwise I use [Visual Studio](https://visualstudio.microsoft.com/), mostly for debugging

---

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [January 11, 2020, 9:01am UTC](https://root-forum.cern.ch/t/cant-draw-a-user-function/37286/8 "2020-01-11T09:01:31Z")

</div>

Could you tell me what I have to do to appear hints for command line typing in VS Code and debugging on it ? I spend a lot of time because I type code in NOTEPAD. Sometimes my file has some mistakes, only i execute file, i recognized that mistakes.
