while ((input = sr.ReadLine()) != null) { site = new CSite(); //variable instantiation if (input.StartsWith("[")) { ...>Given the following code
> CSite site; //variable declaration > > while ((input = sr.ReadLine()) != null) > { > if (input.StartsWith("[")) > { > site = new CSite(); //variable instantiation > input = input.TrimStart('['); > input = input.TrimEnd(']'); > site.SiteName = input; > site.NodeType = CApplication.NodeType.Site; > } > if (input.StartsWith("Address")) > site.SiteAddress = input.Substring(8); // **ERROR > if (input.StartsWith("DESCRIPTION")) > site.SiteDescription = input.Substring(12); //**ERROR>This compiles with the error "use of unassigned local variable site" and refers to the site in the second two if statements. My question is how can I extend the scope of site in the first if block to those of the second two if blocks?