title: Question on pointers, classes and constructors
body: <p>This is a basic histogram being created but my question in the line TH1F *hist=new TH1F(&quot;hist&quot;, &quot;Histogram&quot;, 100, 0, 100);
  I know pointers help store an address to a object and constructors are helpful in inputting values to objects in a class but what is going in this line ? Is a pointer created and defined as a constructor ? and what is the use of the &quot;new&quot; ?</p>
  <pre><code>// Creating a histogram                                                                                                                                                                                            
  void tut1()
  // Void functions do not return values, simply prints a message so I assume our message here is the histogram, histograms display values but they are not themselves not values                                    
  {
   TH1F *hist=new TH1F(&quot;hist&quot;, &quot;Histogram&quot;, 100, 0, 100);
   // This is just a constructor                                                                                                                                                                                    
   // TH1F is a inherited class from the base class TH1                                                                                                                                                             
   //(the name of the histogram, the title of the histograms, number of bins, start of x axis, and ending paramater of x axis)                                                                                      
   // Here we are accessing TH1F  the capital F is for floats and we use this to use 1D histograms                                                                                                                  
  
   // To Fill the histogram we use                                                                                                                                                                                  
    hist-&gt;Fill(10);
    hist-&gt;Fill(40);
  
   // Add titles for the axis's                                                                                                                                                                                     
  
    hist-&gt;GetXaxis()-SetTitle(&quot;X Axis&quot;);
    hist-&gt;GetYaxis()-SetTitle(&quot;Y Axis&quot;);
  
  
  
    TCanvas *c1 = new TCanvas();
   hist-&gt;Draw();
     // Tcanvas is used to draw our plot it is the window that is used to display our image                                                                                                                         
  }
  </code></pre>