using System;
using System.Collecti ons.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplicat ion1
{
class Program
{
static void Main(string[] args)
{
string[] strings = {"a","bc","def" ,null};
Console.WriteLi ne("strings.Ran k = {0}", strings.Rank);
}
}
}
this prints out strings.rank = 1 (instead of 4)
let me know if I am doing something wrong
--
Jeff Fischman 2 1990
Jeff Fischman wrote:
using System;
using System.Collecti ons.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplicat ion1
{
class Program
{
static void Main(string[] args)
{
string[] strings = {"a","bc","def" ,null};
Console.WriteLi ne("strings.Ran k = {0}", strings.Rank);
}
}
}
this prints out strings.rank = 1 (instead of 4)
1 is perfectly correct. This is a one-dimensional array, so Rank
returns 1. Are you looking for the length of the array, perhaps? Then
it should return 5, not 4.
--
Rudy Velthuis http://rvelthuis.de
"God, please save me from your followers!"
-- Bumper Sticker
Jeff Fischman wrote:
let me know if I am doing something wrong
ms-help://MS.NETFramework .v20.en/cpref2/html/P_System_Array_ Rank.htm
<<
Property Value
The rank (number of dimensions) of the Array.
>>
Since this array is one-dimensional, 1 is correct. I guess you want
Array.Length:
ms-help://MS.NETFramework .v20.en/cpref2/html/P_System_Array_ Length.htm
--
Rudy Velthuis http://rvelthuis.de
"Devlin's First Law - Buyer beware: in the hands of a charlatan,
mathematics can be used to make a vacuous argument look
impressive.
Devlin's Second Law - So can PowerPoint." -- Keith Devlin This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: jr |
last post by:
Sorry for this very dumb question, but I've clearly got a long way to go!
Can someone please help me pass an array into a function. Here's a starting
point.
void TheMainFunc()
{
// Body of code...
TCHAR myArray;
DoStuff(myArray);
|
by: VK |
last post by:
A while ago I proposed to update info in the group FAQ section, but I
dropped the discussion using the approach "No matter what color the cat
is as long as it still hounts the mice". Over the last month I had
enough of extra proof that the cat doesn't hount mice anymore in more
and more situations. And the surrent sicretisme among array and hash is
the base for it.
I summarized all points in this article:...
|
by: truckaxle |
last post by:
I am trying to pass a slice from a larger 2-dimensional array to a
function that will work on a smaller region of the array space. The
code below is a distillation of what I am trying to accomplish.
// - - - - - - - - begin code - - - - - - -
typedef int sm_t;
typedef int bg_t;
sm_t sm;
bg_t bg;
|
by: Alexei A. Frounze |
last post by:
Hi all,
I have a question regarding the gcc behavior (gcc version 3.3.4).
On the following test program it emits a warning:
#include <stdio.h>
int aInt2 = {0,1,2,4,9,16};
int aInt3 = {0,1,2,4,9};
|
by: George |
last post by:
Sub ExcelToListBox()
Dim xRange As Object
Dim ary
Dim xValue As String
xRange = oXL.Range("A1:A9") 'has letters A-H
ary = xRange.value
xValue = ary(3, 1) 'xValue = C
Me.ListBoxPerson.Items.AddRange(ary)
| |
by: Chris H |
last post by:
Okay, I am trying to us a varialble with a list of number values as my data
for an array, yet when I do this it doesnt return any values from the array,
i was able to temporarily fix the proble by just doing s normal array setup
in my function, but the problem is I want the ability to have teh array
values to be changed easily in a varibale style config/include file... Here
is the code i am working with...
...
|
by: dmitrey |
last post by:
howto make Python list from numpy.array?
Thx, D.
|
by: =?Utf-8?B?U2hhcm9u?= |
last post by:
Hi Gurus,
I need to transfer a jagged array of byte by reference to unmanaged
function, The unmanaged code should changed the values of the array, and when
the unmanaged function returns I need to show the array data to the end user.
Can I do that?
How?
|
by: Adam Chapman |
last post by:
Hi,
Im trying to migrate from programming in Matlab over to C. Im trying
to make a simple function to multiply one matrix by the other. I've
realised that C can't determine the size of a 2d array, so im
inputting the dimensions of those myself.
The problem is that the output array (C=A*B) has as many rows as A and
as many columns as B. I would think of initialising C with:
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |