Well...yes..but I at the end I figured out that I did not need to create 150 variable names. An array worked fine. Sorry for the newbie question, I am a newbie and basically I've learned not to be afraid of asking "newbie" or stupid questions. That's the way I learn.... once again I apologize f :) r my idiocy.
Sundeepan Sen
Posts
-
I need to create 150 variable names....need an efficient way of doing it -
I need to create 150 variable names....need an efficient way of doing itHey thanks! I think I fixed it. Sorry for the stupid question...
-
I need to create 150 variable names....need an efficient way of doing itI am trying to return an array...but I cant do return objectArray; the compiler error: Error 1 Cannot implicitly convert type 'Interactive.Geo.WellLog.Track.cgStackedTrack[]' to 'Interactive.Geo.WellLog.Track.cgStackedTrack' C:\Program Files\INT\Net\3.0.3693.0\Tutorials\WellLog.NET\StackedTrackTutorial\StackedTrackTutorial.cs 177 20 StackedTrackTutorial
-
I need to create 150 variable names....need an efficient way of doing itheh, cool..so now i'm stuck at how to return all the elements of an array at the end of a method I cant do
for(int i = 0; i < 20; i++)
{
return arrayOfObjects[i];
}I will have unreachable code.
-
I need to create 150 variable names....need an efficient way of doing itWhat if its an array of objects? class[] object = new class();?
-
I need to create 150 variable names....need an efficient way of doing itI need to create 150 variable names. They must be like "varName01" , "varName01" all the way to 150. How do I do this using a for or while loop? thanks! Sundeep
-
I need critique on this codeThank you for your reply and the link! :-O
-
I need critique on this codeSounds like candy...haha
-
I need critique on this codeOh c'mon my friend...your statement helped me more than any other reading I did today :-D
-
I need critique on this codeLOL-i.pop();
-
I need critique on this codeAhh...I understand. Thanks!
-
I need critique on this codeIt only handles inputs in a*b-c/d format. The code is very basic, written in an non elegant way. I will look at your code, it might give me some insights.
-
I need critique on this codeWhy are regions in a method a bad idea? I ask this risking sounding like a fool.
-
I need critique on this codelol...I know exactly which variable name you are referring to.
-
I need critique on this codeJust got back into writing code after 10 years. This is a infix to postfix converter. Can someone please critique this... thanks
using System;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;namespace Infix2Postfix
{
public class Program
{
static void Main(string[] args)
{
#region variable declarations
//declare and initialize the string to accept an expression in infix notation
String stringInfix = "a+b/c-d";StringBuilder SbPostfix = new StringBuilder(); Stack<char> stackGeneral = new Stack<char>(); Stack<char> stackOperator = new Stack<char>(); char\[\] tempArray = stringInfix.ToCharArray(); Array.Reverse(tempArray); Regex regexAlphaNum = new Regex("\[a-zA-Z0-9\]"); char temp; #endregion #region logic foreach (char ch in tempArray) stackGeneral.Push(ch); foreach (char ch in stackGeneral) { if (regexAlphaNum.IsMatch(Convert.ToString(ch))) SbPostfix.Append(ch); else if (stackOperator.Count == 0) stackOperator.Push(ch); else if (stackOperator.Count != 0) switch (ch) { case '+': temp = stackOperator.Peek(); if (temp == '\*' || temp == '/') { while (stackOperator.Count > 0) SbPostfix.Append(stackOperator.Pop()); stackOperator.Push(ch); } else stackOperator.Push(ch); break; case '-': temp = stackOperator.Peek(); if (temp == '\*' || temp == '/') { while (stackOperator.Count > 0) SbPostfix.Append(stackOperator.Pop()); stackOperator.Push(ch); } else stackOperator.Push(ch);
-
Inheritance/Polymorphism [modified]This is great, I like the humor involved too. I am saving this reply as a PDF on my computer. Thanks again!
-
Inheritance/Polymorphism [modified]Its a "Microsoft Press" book for the 70-536 cert exam...this guy better be a good technical writer lol!
-
Inheritance/Polymorphism [modified]This is the paragraph that threw me off: "Another benefit of inheritance is the ability to use derived classes interchangeably, a concept called polymorphism. For example, there are five classes that inherit from the System.Drawing.Brush base class: HatchBrush, LinearGradientBrush, PathGradientBrush, SolidBrush, and TextureBrush. The Graphics.DrawRectangle method requires a Brush object as one of its parameters however, you never pass an object of the base Brush class to Graphics.DrawRectangle. Instead you pass an object of one of the derived classes. Because they are each derived from the Brush class, the graphics.DrawRectangle method can accept any of them. Similarly if you were to create a custom class derived from the Brush class, you could also pass an object of that class to Graphics.DrawRectangle. "
-
Inheritance/Polymorphism [modified]So if I wrote
class Farm
{
public void Pet(Cow chicken){}
}I can access both Foo and Moo? But if I wrote
class Farm
{
public void Pet(Animal man){}
}then I can only access the Foo method? Lol..nice example though....clarification is needed if you don't mind :-D
-
Inheritance/Polymorphism [modified]Hello all, my name is Sundeepan and I am new to this board and to coding as well. To train myself and get familiar with OOP concepts using the C# language I am reading, "Microsoft .NET Framework - Application Development Foundation" book by Tony Northrup. I am finding this book very informative. I do have a question that I was not able to find an answer to by querying Google. The question is as follows: If a method requires an object as one of its parameters why should one not pass an object of a base class, instead one must pass an object of the derived class? I understand that this might be a foolish question, but I am at a very early stage of my learning, any help would be appreciated. Metaphors are equally as helpful as a technical answer. Regards Sundeepan http://sundeepinthought.blogspot.com
modified on Friday, February 5, 2010 12:32 AM