|
No you can't...
An object is basically a block of memory that has been allocated and configured according to the blueprint.(Reference[^])
An object is an instance of a class which acts as its template.
A class is a construct that enables you to create your own custom types by grouping together variables of other types, methods and events. (Reference[^])
A struct type is a value type(Reference[^])
An interface contains only the signatures of methods, delegates or events.(Reference[^])
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
how can I refer to class, struct and interface with respect C# (lessical) building block? or??
I mean If I want to say the main building block in C# are: class, struct, interface, .
is there a more precise word than building block
|
|
|
|
|
You can use ?? for both objects(instances of classes) and struct instances.
You can't do anything like this with respect to interfaces, but you can do it using classes that implement a given interface.
I hope this is what you mean with your question. I'm guessing on what you actually mean.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
I'm sure I'm not clear. In a email I should say:
'The building block of C# language are: classes, structs and interface'
I'm asking if is there a synonymous of building block (I'm looking for a word, I thought to use the word object, but you explained it is wrong)
modified 17-Oct-12 17:00pm.
|
|
|
|
|
Marcus Kramer wrote: An interface contains only the signatures of methods, delegates or events. And properties.
/ravi
|
|
|
|
|
Despite the numerous defintions you can roughly say that:
An interface is like a template for a class and a class is a template for an object.
A struct is nothing more then a name for a group of variables that belong together.
|
|
|
|
|
No, because "object" is a concept in C# and other object-oriented languages, which causes confusion (as you've seen in the replies so far).
I would say that class, struct, and interface are elements or components of C#, although strictly speaking interfaces do not exist on their own - an interface that is not implemented has no purpose.
|
|
|
|
|
I have a C# 2008 console application where all the output is displayed in DOS popup windows instead of being written to a log file.
Thus can you tell me what I can do to have all messages in this console application appear in a log file instead of these dos pop windows? Can you show me in code how to accomplish this goal?
|
|
|
|
|
It's a little too big a solution to do in a single post, so I'll link you to a good CP article that will give you a full solution.
log4net Tutorial[^]
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
You can pipe the stdout to a file, like this (run from console)
C:\> MyProgram.exe >C:\Temp\MyFile.txt
Also works from Windows-shortcuts.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
If the following is true.
1. ONLY log output is written (presumably the case)
2. You can change the code
Then you might want to try using the System.Console.SetOut() method.
You can provide your own writer which you can then put the data anywhere you want.
|
|
|
|
|
If you can change the code you can basically change all Console.WriteLine("") to a log function.
Example:
public void WriteLog(string logtext){
StreamWriter writer = new StreamWriter("[path here]", true);
writer.writeLine(DateTime.Now.ToString() + ": " + text);
writer.Close();
}
hope this helps.
|
|
|
|
|
Hello my friends,
I want to develop a AutoData C# winform application but the first thing I want to know is, how become I all the technical information? I can not start the project...
I google it about a autodata database or a webservice that will give me information, but nothing found...
Can anyone, anywhere help me?
Regards,
KZ
|
|
|
|
|
Killzone DeathMan wrote: Can anyone, anywhere help me?
What's this "autodata" that you speak of? Is it a website, a service, an idea, an application, a business?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Unfortunately for you, AutoData is a subscription based service, so you have to purchase a subscription to get access to the underlying auto data. You can find more details here[^].
|
|
|
|
|
You are right men, thats it!
But I want to do a c# winform app that do all that stuff!
The problem is: where can I get all the technical information?
|
|
|
|
|
AutoData source this information from the vehicle manufacturers themselves.
|
|
|
|
|
Ohhh
Thanks men , I cannot browse all the information, its too much...
Thanks again and have a nice day!
Regards,
KZ
|
|
|
|
|
Sorry about that. Good luck.
|
|
|
|
|
Thanks for your help and if you need something let me know!
|
|
|
|
|
Pascal's Triangle in C program using loop
|
|
|
|
|
From what I can gather, it was Colonel Mustard in the Drawing Room with the Candlestick.
|
|
|
|
|
a free Google-fu search for you[^]
Next Google-fu search costs a pound
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Can I have a few of them please, I could use losing a few pounds!
If you send me a LMGTFY for weight loss I will be mightily displeased
Never underestimate the power of human stupidity
RAH
|
|
|
|
|