Click here to Skip to main content
15,917,793 members
Home / Discussions / C#
   

C#

 
GeneralRe: updating treeview from another thread Pin
Ista14-Aug-03 6:50
Ista14-Aug-03 6:50 
GeneralXPath question Pin
Mazdak13-Aug-03 0:55
Mazdak13-Aug-03 0:55 
GeneralRe: XPath question Pin
Kannan Kalyanaraman13-Aug-03 1:07
Kannan Kalyanaraman13-Aug-03 1:07 
GeneralRe: XPath question Pin
Mazdak13-Aug-03 1:13
Mazdak13-Aug-03 1:13 
GeneralRe: XPath question Pin
Anonymous13-Aug-03 4:42
Anonymous13-Aug-03 4:42 
GeneralRe: XPath question Pin
Arjan Einbu13-Aug-03 5:05
Arjan Einbu13-Aug-03 5:05 
GeneralRe: XPath question Pin
Mazdak13-Aug-03 5:43
Mazdak13-Aug-03 5:43 
GeneralRe: XPath question Pin
Arjan Einbu13-Aug-03 11:51
Arjan Einbu13-Aug-03 11:51 
Generalsimple unicode conversion Pin
Anonymous12-Aug-03 23:53
Anonymous12-Aug-03 23:53 
GeneralRe: simple unicode conversion Pin
Nnamdi Onyeyiri13-Aug-03 0:40
Nnamdi Onyeyiri13-Aug-03 0:40 
GeneralA RAY Pin
eggie512-Aug-03 22:36
eggie512-Aug-03 22:36 
GeneralRe: A RAY Pin
J. Dunlap12-Aug-03 22:54
J. Dunlap12-Aug-03 22:54 
GeneralRe: A RAY Pin
eggie513-Aug-03 13:31
eggie513-Aug-03 13:31 
GeneralRe: A RAY Pin
Nnamdi Onyeyiri13-Aug-03 0:45
Nnamdi Onyeyiri13-Aug-03 0:45 
GeneralRe: A RAY Pin
eggie513-Aug-03 13:31
eggie513-Aug-03 13:31 
GeneralRe: A RAY Pin
James T. Johnson13-Aug-03 9:20
James T. Johnson13-Aug-03 9:20 
There are two different ways of interpreting what you write:

1) You know the size of the array at runtime, but not at compile time.

public int [] CreateArray(int size)
{
  int [] array = new int[size];
 
  return array;
}
The second method is when you don't know ahead of time how many elements you'll need. This typically happens when you are dealing with data being input by the user.

public int[] CreateArray()
{
  string input = "";
  ArrayList alist = new ArrayList();
 
  Console.WriteLine("Enter a number then press enter, to quit just press enter");

  while("" != (input = Console.ReadLine()) )
  {
    int i;

    try
    {
      i = int.Parse(input);
    }
    catch
    {
      Console.WriteLine("\"{0}\" is not a valid input number, try again",
        input);
      continue;
    }
 
    alist.Add(i);
  }
 
  return (int[]) alist.ToArray(typeof(int));
}
All code has not been compiled so errors my exist

James

"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think.
" - Thick as a Brick, Jethro Tull 1972

GeneralRe: A RAY Pin
eggie513-Aug-03 13:31
eggie513-Aug-03 13:31 
GeneralRe: A RAY Pin
eggie53-Jan-04 17:32
eggie53-Jan-04 17:32 
GeneralTreeview embedded in a listview Pin
Ista12-Aug-03 18:34
Ista12-Aug-03 18:34 
GeneralRe: Treeview embedded in a listview Pin
Furty12-Aug-03 22:02
Furty12-Aug-03 22:02 
QuestionWho knows what I need to install in the client system to run a C# application? Pin
yboc12-Aug-03 18:22
yboc12-Aug-03 18:22 
AnswerRe: Who knows what I need to install in the client system to run a C# application? Pin
Furty12-Aug-03 22:11
Furty12-Aug-03 22:11 
GeneralRe: Who knows what I need to install in the client system to run a C# application? Pin
yboc13-Aug-03 17:14
yboc13-Aug-03 17:14 
QuestionHow to have sub-properties in a custom control? Pin
Alvaro Mendez12-Aug-03 16:09
Alvaro Mendez12-Aug-03 16:09 
AnswerRe: How to have sub-properties in a custom control? Pin
J. Dunlap12-Aug-03 16:43
J. Dunlap12-Aug-03 16:43 

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.