Click here to Skip to main content
15,896,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: Howto Delete a file at run time!?! Pin
Heath Stewart5-Jul-04 5:19
protectorHeath Stewart5-Jul-04 5:19 
GeneralRe: Howto Delete a file at run time!?! Pin
QzRz5-Jul-04 5:25
QzRz5-Jul-04 5:25 
GeneralRe: Howto Delete a file at run time!?! Pin
Colin Angus Mackay5-Jul-04 5:57
Colin Angus Mackay5-Jul-04 5:57 
GeneralRe: Howto Delete a file at run time!?! Pin
QzRz5-Jul-04 9:53
QzRz5-Jul-04 9:53 
GeneralRe: Howto Delete a file at run time!?! Pin
Jeremy Falcon5-Jul-04 10:14
professionalJeremy Falcon5-Jul-04 10:14 
GeneralRe: Howto Delete a file at run time!?! Pin
Colin Angus Mackay5-Jul-04 11:06
Colin Angus Mackay5-Jul-04 11:06 
GeneralObject reference not set to an instance of an object Pin
rturner0035-Jul-04 4:34
rturner0035-Jul-04 4:34 
GeneralRe: Object reference not set to an instance of an object Pin
Colin Angus Mackay5-Jul-04 4:43
Colin Angus Mackay5-Jul-04 4:43 
1: int intCount = 2;
2: Answers[] ans = new Answers[intCount];
3: ans[1].Question_No = 3;


I've numbered the lines above.

In line 2 all you are doing is reserving the space for the objects. You still have to create them. So after line 2 you need to do

ans[0] = new Answer();

Also, remeber that indexes in C# are zero-based. I don't know if you knew that, but it looked odd (line 3) that you were starting on index 1.


"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar

The Second EuroCPian Event will be in Brussels on the 4th of September

Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

My Blog


GeneralRe: Object reference not set to an instance of an object Pin
Heath Stewart5-Jul-04 4:53
protectorHeath Stewart5-Jul-04 4:53 
GeneralRe: Object reference not set to an instance of an object Pin
exhaulted5-Jul-04 5:00
exhaulted5-Jul-04 5:00 
GeneralRe: Object reference not set to an instance of an object Pin
rturner0035-Jul-04 5:54
rturner0035-Jul-04 5:54 
Generalupdating label in main form Pin
Jason Ranin5-Jul-04 4:16
Jason Ranin5-Jul-04 4:16 
GeneralRe: updating label in main form Pin
exhaulted5-Jul-04 4:24
exhaulted5-Jul-04 4:24 
GeneralReading TOC and text from Word 2002 Pin
Steven_T5-Jul-04 2:34
Steven_T5-Jul-04 2:34 
QuestionHow to add custom properties in PropertyGrid at Runtime Pin
ilmian5-Jul-04 1:34
ilmian5-Jul-04 1:34 
Questionhow to get my computer speed Pin
maro-gb5-Jul-04 1:10
maro-gb5-Jul-04 1:10 
AnswerRe: how to get my computer speed Pin
Heath Stewart5-Jul-04 5:29
protectorHeath Stewart5-Jul-04 5:29 
Generalgenerics Pin
noraguta5-Jul-04 0:21
noraguta5-Jul-04 0:21 
GeneralRe: generics Pin
noraguta5-Jul-04 1:52
noraguta5-Jul-04 1:52 
Questionhow to make a customized control box Pin
Imran Ahmed Khan5-Jul-04 0:11
Imran Ahmed Khan5-Jul-04 0:11 
AnswerRe: how to make a customized control box Pin
Heath Stewart5-Jul-04 5:17
protectorHeath Stewart5-Jul-04 5:17 
GeneralPrinting Pin
exhaulted5-Jul-04 0:06
exhaulted5-Jul-04 0:06 
GeneralRe: Printing Pin
exhaulted5-Jul-04 0:21
exhaulted5-Jul-04 0:21 
GeneralConverting Pixels to 100/Inch Pin
exhaulted5-Jul-04 0:59
exhaulted5-Jul-04 0:59 
GeneralRe: Converting Pixels to 100/Inch Pin
Pain_Elemental5-Jul-04 2:19
Pain_Elemental5-Jul-04 2:19 

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.