Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
See more:
C#
struct STUDENT
       {
           public CookieContainer fio;
           public string htmlx;
        }


C#
public Form1()
        {
            InitializeComponent();
         var s = impulse();

        }



C#
public ... impulse()
{
  STRUCT str;
  str.fio= "Surname";
  str.htmlx = "asdas"
}
   return str
}
Posted
Comments
Kenneth Haugland 31-Jul-12 19:04pm    
Not to be rude to you, bit SA is right, asking questions here might not be the best place to start... You should read this before posting more questions: http://msdn.microsoft.com/en-us/library/aa288436%28v=vs.71%29.aspx its a tutorial in C# from Microsoft. Take care :)

C#
public STUDENT impulse()


and replace STRUCT with STUDENT.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 31-Jul-12 18:50pm    
You knew! (Just kidding, a 5 :-)
OP needs something else. Please see my answer.
--SA
Exactly as with any other type:

C#
struct Student { /* ... */ }

//...
Student Impulse() { //what's wrong with you naming?
   Student student = new Student();
   student.FullName = "Vasiliy Ivanovich Pupkin";
   student.Html = "How knows what the hell is that?";
   // I changed names to humanly style according to Microsoft naming conventions, removed ugly abbreviation "fio" // I know what do you mean, how abut others?
}


But reasonable people do something like this:
C#
struct Student {
    internal Student(string fullName, string html) { FullName = fullName; Html = html; }
    internal string FullName;
    internal string Html;
}

//...
Student Impulse() {
   return new Student("Vasiliy Ivanovich Pupkin", "How knows what the hell is that?");
}
// the simplicity of this method suggests that it makes no sense, but you need just an idea...


Well, after 35 questions asked on CodeProjects… (sigh)…

I guess you need completely different thing. This:
Microsoft Q209354.

No offense, OK? You really need exactly that.

Good luck, товарищ,
—SA
 
Share this answer
 
Comments
Kenneth Haugland 31-Jul-12 18:56pm    
A 5 for that. :)
Sergey Alexandrovich Kryukov 31-Jul-12 18:59pm    
Thank you, Kenneth.
--SA
lewax00 31-Jul-12 20:05pm    
Agreed, +5
Sergey Alexandrovich Kryukov 1-Aug-12 0:26am    
Thank you.
--SA
pasztorpisti 1-Aug-12 18:03pm    
That link rocks! Didn't know that there is a Qxxxxx for RTFM. 5ed :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900