blah blah blah is here! blah blah » Close

0
votes
1 answers

Do methods create garbage?

This is probably the third time Ive asked if something in C# creates garbage. :P Ive read a couple tutorials but they explain only about using keyword 'new'. Does this mean that garbage is ONLY created when 'new' is used? I ask in tit ...

0
votes
2 answers

How to copy fields by value?

I have fields from 'ClassA' that I would like to copy to 'ClassB' without being 'linked' to 'ClassA' afterwards. (Pass by value is what I think I mean :P) I can do this fine with arrays after Vulpes showed me how I can use the Copy funct ...

1
votes
2 answers

Problem with clearing class array to 0's (Solved)

Heres a quick rundown of what Im trying to do, and what the results are. 1. I have a class for triggered events called TriggerSystem with public 'int' fields. 2. TriggerSystem has a single instance created in another class called Game ...

0
votes
1 answers

Does Random() create garbage?

Im trying not to generate garbage, but Im unsure if random does. If so, would a pregenerated array of random #'s during a specified garbage collection ahead of time be more efficient anyway? Thanky :D

0
votes
1 answers

Object reference not set to an instance of an object.

This should be fairly simple. I think Im probably implementing my code the wrong way slightly or something. Anyway, take a look at line 19 and thats where the error pops up. http://pastebin.com/m1e632aab Thanks ahead of time to Vulpes, a ...

0
votes
1 answers

'for' statement not working properly

Hello again! Normally I always start my 'for' statements with a 0. Everything has worked fine until today. I wanted to have one that starts and runs from 0 - 1250. The other, 1250 - 2500. Heres my working code: http://pastebin.com/m34c ...

0
votes
1 answers

Can you determine array element if its unknown?

Hey guys, another array question :P Lets say we have a 1D array with 10 elements. Element - Value 0 = 20 1 = 21 2 = 22 3 = 23 4 = 24 5 = 25 6 = 26 7 = 27 8 = 28 9 = 29 Now lets say I want to search for the value 25. I can use th ...

0
votes
1 answers

Can you compare array elements to each other?

Just to clarify, I simply want to be able to compare the array elements to one another, not the actual value inside the element. Not sure if thats possible without adding extra variables though. Thank you!

0
votes
1 answers

'if' statement with array in it, not working properly

Hey guys, whenever I have a problem I try to attack it the best I can on my own. But this one is different than I have ever seen before. All data and paths seem to show that everything 'should' be working, but yet a problem occurs half way ...

0
votes
1 answers

How to manipulate other programs

I was just wondering if it is possible to write a program that can manipulate other programs in C#. A few examples: -Automaticly typing out a prewritten line of text to an instant messenger program. -Executing commands automaticly in a g ...

0
votes
1 answers

Changing inheritance values

I looked on google but didnt see anything about this, that or it was right in front of me but I didnt know what I was looking for exactly. What I want is pretty basic. (or so I think :P ) Lets say I have a parent class, we will call it 'h ...

0
votes
1 answers

Trouble understanding private vs public instance variables

I am still foggy on this concept. Let me explain what I grasp (or think I do) so far. I will use this code as reference: class TestClass { private int privVar = 5; public int PubVar = 3; } (I know I am missing some cod ...

Feedback