Regarding c++ object creation
<p>In the program below:</p>

<pre><code>using namespace std;
class c1;
class c2;
int main(int argc,char* argv[])
{
   **c1 obj;
   c2 obj_c2 = obj.method1();**
   return0;
}
class c1
{
public:
  c2 method1()
  {
     c2 obj1;
     return obj1;
  }
};
class c2
{
public:
  int method2()
  {
    return 1;
  }

};
</code></pre>

<p>Inside main function, two lines of code are giving error. I could not compile.</p>
