Instantiating GameObject as a child of another GameObject

Hello, I was working on my game when I tried to Instantiate a GameObject as a child and got errors.

Code:
using UnityEngine;
using System.Collections;

public class InCorrect : MonoBehaviour {

public Transform Canvas;
GameObject Correct;
public GameObject CorPrefab;
GameObject Incorrect;
public GameObject IncPrefab;

// Use this for initialization
void Start () {
Correct = Instantiate (CorPrefab, new Vector3 (0f,0f,0f), Quaternion.identity);
Correct.transform.parent = Canvas;
}

// Update is called once per frame
void Update () {

}
}

If the transform Canvas is a UI Canvas then you should take a look at this.

Got errors? Mind telling us the specific error you got?

Don’t know about the UI stuff, but Correct.transform.parent takes a transform not a gameObject so

Cirrect.transform.parent=Canvas.transform;