473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

What is the memset function in C#

What i want to do is the following:
I want to first of all copy one value from another array into my current
array.....then i want to copy this same value a specified number of
times. The Buffer class only lets me copy one value to one place in my
current array. I dont want to use a big awkward "For loop" to set all
the values in my array.So here i will put it in steps what i want to do.
1. I have my main array
2. I have my current array.
3. I want to copy one value from the main array n(e.g. 10)....number of
times to my current array.

memset function does this in earlier visual studio....what does this in
C#.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 9884
James,

You can write a little helper routine containing the loop, and call this
helper from your main code. This way, the code won't look awkward.

P.S. Well, the Buffer class might actually have had a some kind of Fill
method. I don't know why Microsoft has limited it to only copying bytes -
probably because direct memory access is not favored in managed programming
and it might degrade the performance.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"James Dean" <m_*******@yahoo.com> wrote in message
news:OT**************@TK2MSFTNGP11.phx.gbl...
What i want to do is the following:
I want to first of all copy one value from another array into my current
array.....then i want to copy this same value a specified number of
times. The Buffer class only lets me copy one value to one place in my
current array. I dont want to use a big awkward "For loop" to set all
the values in my array.So here i will put it in steps what i want to do.
1. I have my main array
2. I have my current array.
3. I want to copy one value from the main array n(e.g. 10)....number of
times to my current array.

memset function does this in earlier visual studio....what does this in
C#.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: varois83 | last post by:
Hi I am a newbie and struggling with my guestbook validation process. I have found the following function online to check the length of a form field. <?php function checkLength($string,...
5
by: Bart Nessux | last post by:
I have 2 functions among others. One gets a URL and returns its, For example, it returns 'http://127.0.0.1' How can I pass this to another function? I've never worked with code that has lots of...
10
by: Brad Tilley | last post by:
Is there an easier way to do this: def print_whats_returned(function): print function print type(function)
354
by: Montrose... | last post by:
After working in c# for a year, the only conclusion I can come to is that I wish I knew c. All I need is Linux, the gnu c compiler and I can do anything. Web services are just open sockets...
3
by: Yo | last post by:
I want to put an icon in the systray. I don't think VBA does this. Is there a VC++ or C++ Function or Sub that I can declare that will allow me to create a systray icon (or is it...
10
by: sabarish | last post by:
hi friend, what is function pointer how it is useful? plz help me.
21
by: Jim Langston | last post by:
I'm sure this has been asked a few times, but I'm still not sure. I want to create a function to simplify getting a reference to a CMap in a map. This is what I do now in code: ...
10
by: rh0dium | last post by:
Hi all, Below is a basic threading program. The basic I idea is that I have a function which needs to be run using a queue of data. Early on I specified my function needed to only accept basic...
4
by: LAN MIND | last post by:
?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.