[ create a new paste ] login | about

Link: http://codepad.org/ihSIGjZ2    [ raw code | output | fork ]

C++, pasted on Feb 23:
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
using namespace std;
class Total
{
    //cin>>sub1
    //cin>>sub2
    //cin>>sub3
    float sub1,sub2,sub3;
    total=sub1+sub2+sub3;
    cout<<"Total="<<total
}


Output:
1
2
Line 9: error: 'Total::sub1' cannot appear in a constant-expression
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: