Sign up to create your own snipts, or login.

Public snipts » a The latest public a snipts.

showing 1-6 of 6 snipts for a
  • image link
    <? 
    $img_path = "/images/arr_leggi_blu.gif"; 
    $link_path = "node/47";
    $theme_name = 'pmsth';
    
    $img = theme('image',  drupal_get_path('theme', 'pmsth'). $img_path); 
    print l($img, $link_path, array('html' => true));
    
    ?>
    

    copy | embed

    0 comments - tagged in  posted by allaterza on Feb 06, 2010 at 6:24 a.m. EST
  • queue
    #include <iostream>
    #include <queue>
    using namespace std;
    int main()
    {
        queue<int>myqueue;
        queue<int>myqueue2;
        for(int j=1;j<=10;j++)
        {
            myqueue.push(j);
        }
        int i;
        for(i=myqueue.size();i>0;i--)
        {
            cout<<myqueue.front()<<" ";
            myqueue2.push(myqueue.front());
            myqueue.pop();  //removes the top element
        }
        cout<<endl<<endl;
        for(int h=1;h<=3;h++)
        {
            myqueue.push(myqueue2.front());
            myqueue2.pop();
        }
            for(i=myqueue2.size();i>0;i--)
        {
            cout<<myqueue2.front()<<" ";
            //myqueue2.push(myqueue.front());
            myqueue2.pop();  //removes the top element
        }
            for(i=myqueue.size();i>0;i--)
        {
            cout<<myqueue.front()<<" ";
            //myqueue2.push(myqueue.front());
            myqueue.pop();  //removes the top element
        }
    }
    

    copy | embed

    0 comments - tagged in  posted by Fatal_eX on Jan 18, 2010 at 8:24 p.m. EST
  • Posting a link
    <a href="http://URL" > the link < /a >
    

    copy | embed

    0 comments - tagged in  posted by saravanansaravanan on Jan 17, 2010 at 6:19 a.m. EST
  • A Recursive Example - Factorial
    #include <iostream>
    
    using namespace std;
    
    
    
    int main()
    {
        int i=10;
        int recur_factorial(int i);
        cout<<recur_factorial( i);
    }
    
    
    int recur_factorial(int i)
    {
    	if ( i == 0)
           return 1;
    	else
      {
          return i * recur_factorial(i - 1);
    	}
    }
    

    copy | embed

    0 comments - tagged in  posted by HD on Nov 22, 2009 at 10:09 p.m. EST
  • s1
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    int main()
    {
        string s1;
        s1="Singapore Polytechnic is the oldest polytechnic!";
        cout<<s1<<endl;
        s1.replace(29,6,"coolest");
        cout<<s1;
    
    }
    

    copy | embed

    0 comments - tagged in  posted by Fatal_eX on Nov 09, 2009 at 8:10 p.m. EST
  • template
    #include <iostream >
    
    using namespace std;
    
    double l, h, w, Area, Volume;
    template <typename T>
    int calcArea( T h,T w)
    {
        Area = h*w;
    }
    template <typename N>
    int calcVol(N Area, N l)
    {
        Volume = l*Area;
    }
    
    int main()
    {
        cout<<"Please enter height: ";
        cin>>h;
        cout<<"Please enter width: ";
        cin>>w;
        cout<<"Please enter length: ";
        cin>>l;
        calcArea(h, w);
        calcVol(Area, l);
    
    
        cout<<"\nArea : "<<Area<<endl;
        cout<<"Volume : "<<Volume<<endl<<endl;
        cout<<":)"<<endl;
    
        cin.get();
        cin.get();
        return 0;
    }
    

    copy | embed

    0 comments - tagged in  posted by Fatal_eX on Nov 08, 2009 at 10:19 p.m. EST
Sign up to create your own snipts, or login.