Click here to Skip to main content
15,895,794 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sending email using c# Pin
YAI17-Apr-08 18:03
YAI17-Apr-08 18:03 
GeneralPrintPreviewDialog printer selection. Pin
msx2310-Apr-08 12:54
msx2310-Apr-08 12:54 
GeneralRe: PrintPreviewDialog printer selection. Pin
Luc Pattyn10-Apr-08 13:50
sitebuilderLuc Pattyn10-Apr-08 13:50 
GeneralAnoying add-in, context menu, problem... Pin
Kasic Slobodan10-Apr-08 12:16
Kasic Slobodan10-Apr-08 12:16 
GeneralSimple C# array of classes question? (C# vs C++ ) Pin
Pinhead_Me10-Apr-08 10:25
Pinhead_Me10-Apr-08 10:25 
GeneralRe: Simple C# array of classes question? (C# vs C++ ) Pin
Luc Pattyn10-Apr-08 10:51
sitebuilderLuc Pattyn10-Apr-08 10:51 
GeneralRe: Simple C# array of classes question? (C# vs C++ ) Pin
Guffa10-Apr-08 16:39
Guffa10-Apr-08 16:39 
GeneralRe: Simple C# array of classes question? (C# vs C++ ) Pin
#realJSOP11-Apr-08 4:41
mve#realJSOP11-Apr-08 4:41 
Guffa wrote:
The equivalent in C# would be to use a struct instead of a class.


Even then, he'd have to write additional code to initialize the data members. The best overall solution is to use a generic list

using System.Collections.Generics;

namespace MyApp
{
    class Program1
    {
        public class MyClass
        {
            private int m_data = -1;
            public int Data
            {
                get { return m_data; }
                set { m_data = value; }
            }
            public MyClass()
            {
                m_data = -1;
            }
            public MyClass(int data)
            {
                m_data = data;
            }
        }

        static void Main(string[] args)
        {
            List<myclass> myClasses = new List<myclass>();

            for (int i = 0; i < 12; i++)
            {
                MyClass myClass = new MyClass();
                myClasses.Add(myClass);
            }
        }
    }
}
</myclass></myclass>



"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: Simple C# array of classes question? (C# vs C++ ) Pin
Guffa11-Apr-08 11:13
Guffa11-Apr-08 11:13 
GeneralRe: Simple C# array of classes question? (C# vs C++ ) Pin
Pinhead_Me11-Apr-08 18:56
Pinhead_Me11-Apr-08 18:56 
GeneralRe: Simple C# array of classes question? (C# vs C++ ) Pin
Guffa12-Apr-08 14:15
Guffa12-Apr-08 14:15 
Generalinterpret address locations Pin
shwaguy10-Apr-08 10:25
shwaguy10-Apr-08 10:25 
GeneralRe: interpret address locations Pin
pmarfleet10-Apr-08 10:56
pmarfleet10-Apr-08 10:56 
GeneralRe: interpret address locations Pin
shwaguy28-Apr-08 4:44
shwaguy28-Apr-08 4:44 
GeneralSub Form Pin
rockNroll10-Apr-08 10:22
rockNroll10-Apr-08 10:22 
GeneralRe: Sub Form Pin
Luc Pattyn10-Apr-08 10:55
sitebuilderLuc Pattyn10-Apr-08 10:55 
GeneralDataGridView binding Pin
Shekelele10-Apr-08 9:54
Shekelele10-Apr-08 9:54 
GeneralRe: DataGridView binding Pin
sarilee10-Apr-08 21:09
sarilee10-Apr-08 21:09 
GeneralRe: DataGridView binding Pin
Shekelele11-Apr-08 4:24
Shekelele11-Apr-08 4:24 
QuestionVideo motion detection and cursor movement Pin
=Momi=10-Apr-08 9:52
=Momi=10-Apr-08 9:52 
GeneralRe: Video motion detection and cursor movement Pin
Christian Graus10-Apr-08 13:00
protectorChristian Graus10-Apr-08 13:00 
QuestionBitmap + Clipboard + Transparency = Blue Background? Pin
Chadwick Posey10-Apr-08 9:49
Chadwick Posey10-Apr-08 9:49 
AnswerRe: Bitmap + Clipboard + Transparency = Blue Background? Pin
Christian Graus10-Apr-08 13:03
protectorChristian Graus10-Apr-08 13:03 
GeneralVeryfy user and password agains a windows account Pin
Ola E10-Apr-08 9:11
Ola E10-Apr-08 9:11 
GeneralHelp with pseudo code / C# Pin
srmanuel10-Apr-08 8:19
srmanuel10-Apr-08 8:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.