Click here to Skip to main content
15,890,690 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to implement cache memory mechanism in C# Pin
Pete O'Hanlon30-Oct-06 2:47
mvePete O'Hanlon30-Oct-06 2:47 
QuestionPackaging Setup Files in a single File [modified] Pin
wasife30-Oct-06 0:42
wasife30-Oct-06 0:42 
AnswerRe: Packaging Setup Files in a single File Pin
FlyOnIT30-Oct-06 1:34
FlyOnIT30-Oct-06 1:34 
QuestionFile permission in C#.net Pin
Kunal Sagwaria29-Oct-06 23:53
Kunal Sagwaria29-Oct-06 23:53 
QuestionEveryone can access my file Pin
Kunal Sagwaria29-Oct-06 23:51
Kunal Sagwaria29-Oct-06 23:51 
QuestionDesign time toolstrips Pin
Gomac29-Oct-06 23:45
Gomac29-Oct-06 23:45 
QuestionRegarding nested structs: Instance Field Initializers Pin
Mairaaj Khan29-Oct-06 23:14
professionalMairaaj Khan29-Oct-06 23:14 
AnswerRe: Regarding nested structs: Instance Field Initializers Pin
Pete O'Hanlon29-Oct-06 23:48
mvePete O'Hanlon29-Oct-06 23:48 
First of all, the field initializer is the bit that states "= new ns1[2];". This is not allowed because structs are value types.

You could use a constructor though (but not a parameterless constructor - structs don't support them):

public struct mystruct    {       <br />
	public mystruct(int amount)<br />
	{<br />
		stary = new ns1[amount];<br />
	}<br />
	public void display()        <br />
	{<br />
            System.Console.WriteLine("My main Sturct");        <br />
	}        <br />
	public struct ns1 //nested struct        <br />
	{            <br />
		public void show(int n)            <br />
		{                <br />
			System.Console.WriteLine("nested struct 1: Call# " + n);            <br />
		}        <br />
	}// the nested struct ns1 ends        <br />
	public ns1[] stary;<br />
} // mystruct ends


Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."

Deja View - the feeling that you've seen this post before.

GeneralRe: Regarding nested structs: Instance Field Initializers Pin
Mairaaj Khan30-Oct-06 0:09
professionalMairaaj Khan30-Oct-06 0:09 
GeneralRe: Regarding nested structs: Instance Field Initializers Pin
kalaveer30-Oct-06 1:24
kalaveer30-Oct-06 1:24 
GeneralRe: Regarding nested structs: Instance Field Initializers Pin
Pete O'Hanlon30-Oct-06 1:39
mvePete O'Hanlon30-Oct-06 1:39 
QuestionFile Browse Window Pin
Rustamyan29-Oct-06 22:44
Rustamyan29-Oct-06 22:44 
AnswerRe: File Browse Window Pin
subrata.jana29-Oct-06 23:05
subrata.jana29-Oct-06 23:05 
GeneralRe: File Browse Window Pin
subrata.jana29-Oct-06 23:07
subrata.jana29-Oct-06 23:07 
AnswerRe: File Browse Window Pin
saqib8230-Oct-06 2:50
saqib8230-Oct-06 2:50 
QuestionSerial port logger testing solution Pin
nemopeti29-Oct-06 22:27
nemopeti29-Oct-06 22:27 
Questionweird error... Pin
Support12329-Oct-06 22:23
Support12329-Oct-06 22:23 
AnswerRe: weird error... Pin
Robert Rohde30-Oct-06 0:21
Robert Rohde30-Oct-06 0:21 
GeneralRe: weird error... Pin
Support12330-Oct-06 1:22
Support12330-Oct-06 1:22 
Questionhow can i get text where mouse point ? Pin
Mory0Tiki29-Oct-06 22:18
Mory0Tiki29-Oct-06 22:18 
AnswerRe: how can i get text where mouse point ? Pin
sam#29-Oct-06 23:01
sam#29-Oct-06 23:01 
GeneralRe: how can i get text where mouse point ? Pin
Mory0Tiki30-Oct-06 6:36
Mory0Tiki30-Oct-06 6:36 
QuestionGiving F10 a Job Pin
myNameIsRon29-Oct-06 21:51
myNameIsRon29-Oct-06 21:51 
AnswerRe: Giving F10 a Job Pin
Pete O'Hanlon29-Oct-06 22:28
mvePete O'Hanlon29-Oct-06 22:28 
AnswerRe: Giving F10 a Job Pin
sam#29-Oct-06 22:57
sam#29-Oct-06 22:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.