TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
zozo ahmed
NA
18
16k
create list of structure and add to list
Feb 20 2014 1:09 AM
I Write this code in
c#
, i declare array of structure but i do not know size of this array , I do not know how declare size for array of structure, i know about list and i try use it , but i do not know how add to list (xb,yb,size)with structure and how declare it?
public
struct
blocks
{
public
Int32
xb;
public
Int32
yb;
public
Int32
size;
};
namespace test
{
class
Program
{
static
static
List
<blocks>
blocks1
=
new
List
<blocks>
();
static
void
Main
(
string
[] args)
{
Int32 index =0;
for
(
int
y =
1
; y <
5
; y++)
for
(
int
x =
1
; x <
5
; x++)
{
blocks1[index].xb=x *
2
;
// store start point (x) of block
blocks1[index].yb = y *
2
;
// store start point (y) of block
blocks1[index].size =
2
;
// store block size
index++; } } } }
Reply
Answers (
1
)
Linq query of search option
Crystal report