4,439 Posted Topics
Re: What have you tried for yourself? We are all willing to help you here with your questions, but you got at least show some effort. Momerath has given you all the info you need to get started. So start to program. If you show some of your(even not working) code, … | |
Re: Hi WhiteTigerclaws, welcome to DANIWEB. I you post code please do it between code tags. Have not much time now but : [CODE=c#]private void btnDisplayScores_Click(object sender, EventArgs e) { scores.Sort(); string scoresString = "List of all scores entered :\n\n"; foreach (int i in scores) scoresString += i + "\n"; MessageBox.Show(scoresString, … | |
Re: Seems to be a rather "popular" topic around here. Look at this thread: [url]http://www.daniweb.com/forums/thread237654.html[/url] | |
Re: @daniel955 Your outer loop goes from 1 to 3, the OP wants it from 1 to 4. The inner loop should probably go from 0 to 9 | |
Re: Please use code tags if you post any code. Perhaps this bit of code will get you on the right track: [CODE=c#]class Program { static void Main(string[] args) { List<istanbul> ap = new List<istanbul>(); ap.Add(new istanbul("dsklfjsf", 12)); foreach (istanbul o in ap) { Console.WriteLine(o.Name); } Console.ReadKey(); //in debug mode } … | |
Re: Suspect you want to test for zero, rewrite line 3 like this: [CODE=c#]c[i][j] = counts[i] == 0 ? c1[i][j] / counts[i] : c1[i][j];[/CODE] As Momerath already pointed out, you cannot use things like [B]while(0)[/B] in C#. I love C# for it!!! :) | |
On the tenth october 2010 it is going to be 10 10 10! (42 decimal in binary) | |
Re: [CODE=C#]while(1)[/CODE] This will never work, C# expects a boolean or an expression that resolves to a boolean. The number 1 resolves to an integer. This is one of the reasons I prefer C# over C and C++ ! | |
Re: Well, the web page does not open... Besides, if you are just learning to program, I would probably not start with a game like Yahtzee. | |
Re: Use the generic Queue type available in .NET Something like: [CODE=c#] Queue<patient> PatientsWaiting = new Queue<patient>(); patient P = new patient(); P.Name = "Smith"; PatientsWaiting.Enqueue(P);[/CODE] | |
Re: Without sending us some of your code or at least telling us what your code does, it is very difficult to answer your question. | |
Re: Or have a look at this snippet : [url]http://www.daniweb.com/code/snippet256776.html[/url] | |
Re: Another way of doing this; is by clicking in the leftmost column of a code listing. A brownish ball will appear and your program will stop there if it is run. You have set a BREAKPOINT! If your program does not stop there, you know that part of your program … | |
Re: You can not have two radii. A shpereradius and a userradius are confusing. A sphere just has ONE radius, which has to be a private property of you Sphere class. | |
Re: There are no dumb questions! Try this: maybe it is a dumb answer :) Do you use the MonoDevelop IDE? >>[COLOR="Green"] to install 7 on parallels[/COLOR] Do you mean Windows 7? I use Boot Camp, which is part of Mac OS X v10.5 and higher and I installed Visual Studio … | |
Re: @CloneXpert: don't use [B]index >= myArrayList.Count[/B] use [B]index > myArrayList.Count[/B] Remember if you have a list with a count of 2, the Indexes go like this: 0, 1 @badboy11 ArrayList can hold any object, but this is perhaps not exactly what you want to do. Take a look at the … | |
Re: If you are taking a course in C#, I should stick to that in the first place. | |
Re: You can also search the C# code snippet section. It contains C# code to do a bubble sort. | |
Re: Whatever you enter in a TextBox it is collected as a string.(Using the Text property of the TextBox) So if you want to do your summation, you have to disect textbox1.Text with the SubString method, and transform the substring obtained to a number by using a Parse method. | |
Hi all, Had a working program with a employee DB in 2008. Opened it in VS 2010 and the conversion wisard was busy doing his thing and asked me for Cristal Reports. A a download beta version was suggested. Any one out there who knows what to do next? Do … | |
Re: If you can't find a final project idea while just learning something, what are you going to do with a much greater project ahead, THE REST OF YOUR LIFE! | |
Re: Line 1: a string litteral is always placed between quotes, so this line should read: [CODE=c#]string str = "12345678901234567890";[/CODE] Line 3 should end in a round bracket [CODE=c#]for (int i = 0; i < 5; i++)[/CODE] Look [url=http://msdn.microsoft.com/en-us/library/system.string.insert.aspxif]here[/url] you want to insert something into a string. | |
Re: You could also simplify your if-statement. If you know that a number is even, it can never be odd, so you could rewrite your if-statement like this: [CODE=c#]if (number % 2 == 0) type = "even"; else type = "odd";[/CODE] @CloneXpert: Yes, C# is indeed a wonderful language to learn! … | |
Re: Start simple. Can you draw a line, rectangle a circle on a form? If not, try to do that first. | |
Re: This a bit of an implementation as Ryshad suggested. I used the Queu class here, but List, Stack, or Array class may fit in as well, depending on your needs. [CODE=c#]static void Main(string[] args) { string str = "4+5-3-6+7"; // make two queus which can hold chars Queue<char> NumberQ = … | |
Re: Has probably to do with [B]public [/B]or [B]private[/B] access modifiers. Check your Global class. Just a remark on the side: It is for several reasons, a bad idea to maintain a class with globals... But please feel free to do whatever you want. At least I'm still rocking in a … | |
Re: Use the overloaded - operator to substract 2 DateTime structures. A TimeSpan object is returned. There is also a Substract method. | |
Re: The integer type only takes whole numbers. If you want real type numbers with a comma, you have to use the float or double types instead of int, to do your calculations. | |
Re: Don't know if it helps, but perhaps you can let your lexer do some syntax checking too. Look at this snippet for a modest example: [url]http://www.daniweb.com/code/snippet217185.html[/url] | |
Re: Take a look at [url=http://www.daniweb.com/code/snippet217206.html]this snippet[/url], follow the instructions and it displays al the "KnownColors" together with their name. You should also refresh the syntax of the switch-case statement. Read this [url=http://msdn.microsoft.com/en-us/library/06tc147t(VS.80).aspx]this MSDN page[/url] as an example. | |
Where do I find the System.Numerics namespace, with things like BigInt and Complex? Just installed Visual Studio 2010 Professional. Google did not make me happy:'( Any help, is as always, much appreciated. | |
Re: [QUOTE=lonley_girl]an assignment [/QUOTE] WHICH ASSIGNMENT?????????? [QUOTE=lonley_girl]to make some graphics in C[/QUOTE] WHAT KIND OF GRAPHICS???????????? | |
Re: Why do you create a Graphics object of your own? You get one for free out of the [B]PaintEventArgs e[/B] parameter from your pzinter event handler.(line 62) | |
Re: Do we talk about bignums here? Look for this [url]http://www.boyet.com/Articles/PiCalculator.html[/url] It is about the calculation of pi, but it contains a C# implemetation of big numbers. | |
Re: @Nyight : I'm no master either, but please test the code you post! I tested this: [CODE=c#]public static bool isPalindrome(int first, string word, int last) { if (word[first] != word[last]) { return false; } else if (first < last) { return isPalindrome(first + 1, word, last - 1); ; } … | |
![]() | Re: The Cursor class does not support any animated cursors(ani files) See [url=http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.aspx]this article[/url] for more info. ![]() |
Re: If you can define your idea as[B] what it does[/B] without the direct need on how it has to be done, use an interface. If you need to have some implementation(how do I do it), use an abstract class. ![]() | |
Re: @anitha10 As a sidenote, I see you have several threads named C#. Please give your threads a more appropriate name. It will help us all.:) | |
Re: Had the same problem once. I worked it out for myself with the aid of some books and the net. What you will need is a scanner, a parser and an engine that drives it all. Look at these snippets, when put together in one project they make up a … | |
Re: I hate the word GUI :@ Call it a USER INTERFACE or UI. In the 21st century,IMHO, EVERYTHING is graphic. Else go back a few decades and use [url=http://en.wikipedia.org/wiki/Teletypewriter]this[/url] | |
Re: To move up in a directory use the Parent property of DirectoryInfo. [B]DirectoryInfo MyParentDir = MyCurrentDir.Parent;[/B]and then say something like: [B]Console.WriteLine("The parent directory of '{0}' is '{1}'", MyCurrentDir.Name, MyParentDir .Name);[/B] | |
Re: Try this out: [CODE=c#]static void Main() { string str = " 123 Lname Fname"; char[] strToParse = str.ToCharArray(); // convert string to array of chars char ch; int charpos = 0; do //skip whitespace except '\n' { ch = strToParse[charpos]; charpos++; } while (ch != '\n' && char.IsWhiteSpace(ch)); charpos--; //Putback … | |
Re: Hi kei1412, welcome! You should have posted your question in a new thread. I think you want more something like this: [url]http://www.daniweb.com/forums/forum61.html[/url] Please look up the two other parts in the code snippet section. | |
As all textbooks on C# will tell you, you cannot instantiate an abstract class. I believe the keyword [B]abstract [/B]was intended for that purpose. So can anyone tell me why I can do something like this: [CODE=c#]abstract class TwoDShape { // some code here } class test { static void … | |
Re: Download the free Visual Studio 2010 Express Edition. It has C# and C++ on board. See if this can be a starting point to learn C#. And NO, I'm not a guy from MS :icon_cheesygrin: | |
Re: Wonder how you could compile this: [CODE=c#]songs = new string[5];[/CODE] Is the variable [B]songs [/B]defined elsewhere? I should say this has to be: [CODE=c#]string[] songs = new string[5];[/CODE] | |
Re: Have you tried debugging and setting a breakpoint? dr.Read() is probably false. | |
Re: Hi MaiHunDown, welcome here! Rather strange question. What do you mean? A TextBox has a Click or MouseClick event. Do you want to show some info in a textbox after clicking a button? |
The End.