473,671 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding values to an open ended array

2 New Member
I am new to C#. Is any one know how to add a series numbers via Console.Write to an open ended array? I think a while loop could accomplish that when sentinel value entered but having trouble to do so:). Thanks!
Oct 3 '08 #1
3 2966
Curtis Rutland
3,256 Recognized Expert Specialist
Console.Write() sends output to the console. You can't do anything other than that with it.
Oct 4 '08 #2
kcdpas
2 New Member
Console.Write() sends output to the console. You can't do anything other than that with it.
Yes, i left Console.Read() which captures user input. but I don't know how to put that value into an open ended array.
Oct 4 '08 #3
Curtis Rutland
3,256 Recognized Expert Specialist
I'm not sure what you mean by open-ended array.

Arrays in C# have defined lengths. What you might want is a List. If these are numbers, you would use List<int> or List<double>.

Something like this:
Expand|Select|Wrap|Line Numbers
  1. List<int> lst = new List<int>();
  2. int i = 20;
  3. lst.Add(i);
  4.  
And you can get a fixed length array from the list once you are done.

Hope that helps.
Oct 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3418
by: Tim Chmielewski | last post by:
I have been trying to read values from a form into an array on a page without much success and was told to use a Scripting.Dictionary instead. There are a variable number of fields on the form as it is different according to which product is ordered (as are the fields that are used to create the record.) This is my first attempt: set OrderInfo = Server.CreateObject("scripting.dictionary") set OrderInfo("prodid") =...
1
3822
by: MattB | last post by:
OK, never mind my last post. It was easy enough to refer to the table the repeater is bound to, but I made a big, incorrect assumption in that post. In my last post I thought I was successfully getting values from the textboxes in my repeater. It turns out I am not and I can't see what I'm doing wrong. I've had this problem before and just ended up taking a different route to avoid it. Now I REALLY need to figure out what I'm doing...
17
12773
by: Sri | last post by:
How do you add an n-bit number in C? Regards, Sri
5
1507
by: Justin Fancy | last post by:
Hi everyone, I need some help. I'm placing text files into a created database using vb.Net. The problem is that, i need two seperate sql statements to add both files because they are in different loops. My output comes out to be as Follows: TABLE ---------------------------------------------------- Field1 Field2
2
3199
by: Justin Fancy | last post by:
Hi everyone, I need some help. I'm placing text files into a created database using vb.Net. The problem is that, i need two seperate sql statements to add both files because they are in different loops. My output comes out to be as Follows: TABLE ----------------------------------------------------
1
3592
by: Wayne Deleersnyder | last post by:
Hi All, I was going to write and ask if someone could help me fix the formatting of my output for hash values, but I believe I got it right now. But, because I couldn't find any website or tutorial to help me with this issue I figured I'd make a post just in case someone else runs into the same issue. ....
11
3149
by: dennis.sprengers | last post by:
Consider the following multi-dimensional array: --------------------------- $arr = array( array(3, 5, 7, 9), array(2, 4, 6, 8), array(1, 3, 5, 7) ); function add_arrays($arr) { for ($row = 0; $row < count($arr); $row++) {
2
2834
by: isaac2004 | last post by:
hello i am trying to read an input file into a matrix, i have the following setup to get the file #include <iostream> #include <string> #include <fstream> using namespace std; int main()
60
2685
by: Bill Cunningham | last post by:
I have a row of values like such, placed in a text file by fprintf. 10.50 10.25 10.00 10.75 11.00 What I want to do to the above colum is add a new column right beside it which is a total of these values and then average them in another column.
0
8483
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8603
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8673
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6236
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2818
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.