Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
GeneralRe: Paste CF_ENHMETAFILE=14 image file Pin
manuellopes15-Jul-17 7:38
manuellopes15-Jul-17 7:38 
GeneralRe: Paste CF_ENHMETAFILE=14 image file Pin
Richard MacCutchan15-Jul-17 20:30
mveRichard MacCutchan15-Jul-17 20:30 
QuestionServicePointManager and TLS1.2 with Gmail Pin
jkirkerx13-Jul-17 6:34
professionaljkirkerx13-Jul-17 6:34 
AnswerServicePoint, Address = 'smtpClient.ServicePoint.Address' threw an exception of type 'System.NotSupportedException', Pin
jkirkerx13-Jul-17 8:45
professionaljkirkerx13-Jul-17 8:45 
GeneralRe: ServicePoint, Address = 'smtpClient.ServicePoint.Address' threw an exception of type 'System.NotSupportedException', Pin
Richard Deeming13-Jul-17 9:52
mveRichard Deeming13-Jul-17 9:52 
GeneralRe: ServicePoint, Address = 'smtpClient.ServicePoint.Address' threw an exception of type 'System.NotSupportedException', Pin
jkirkerx13-Jul-17 11:38
professionaljkirkerx13-Jul-17 11:38 
GeneralRe: ServicePoint, Address = 'smtpClient.ServicePoint.Address' threw an exception of type 'System.NotSupportedException', Pin
jkirkerx13-Jul-17 12:14
professionaljkirkerx13-Jul-17 12:14 
Questionhye :) Pin
Member 1330557812-Jul-17 17:24
Member 1330557812-Jul-17 17:24 
AnswerRe: hye :) Pin
OriginalGriff12-Jul-17 20:23
mveOriginalGriff12-Jul-17 20:23 
GeneralRe: hye :) Pin
Member 1330557812-Jul-17 22:14
Member 1330557812-Jul-17 22:14 
GeneralRe: hye :) Pin
OriginalGriff12-Jul-17 22:36
mveOriginalGriff12-Jul-17 22:36 
AnswerRe: hye :) [Repost] Pin
Richard MacCutchan12-Jul-17 22:28
mveRichard MacCutchan12-Jul-17 22:28 
QuestionRx - Reactive Extensions Pin
Kevin Marois12-Jul-17 6:59
professionalKevin Marois12-Jul-17 6:59 
AnswerRe: Rx - Reactive Extensions Pin
Luc Pattyn12-Jul-17 8:02
sitebuilderLuc Pattyn12-Jul-17 8:02 
GeneralRe: Rx - Reactive Extensions Pin
Kevin Marois12-Jul-17 8:03
professionalKevin Marois12-Jul-17 8:03 
AnswerRe: Rx - Reactive Extensions Pin
Meshack Musundi12-Jul-17 10:45
professionalMeshack Musundi12-Jul-17 10:45 
AnswerRe: Rx - Reactive Extensions Pin
Kenneth Haugland13-Jul-17 13:13
mvaKenneth Haugland13-Jul-17 13:13 
AnswerRe: Rx - Reactive Extensions Pin
jschell15-Jul-17 7:41
jschell15-Jul-17 7:41 
Questionplaying media from server storage help.. in C# Pin
AnthonyRaven11-Jul-17 17:10
AnthonyRaven11-Jul-17 17:10 
AnswerRe: playing media from server storage help.. in C# Pin
Richard MacCutchan11-Jul-17 21:42
mveRichard MacCutchan11-Jul-17 21:42 
QuestionRfid Reader Tag number Extraction Pin
Member 132923109-Jul-17 4:18
Member 132923109-Jul-17 4:18 
AnswerRe: Rfid Reader Tag number Extraction Pin
Michael_Davies9-Jul-17 4:40
Michael_Davies9-Jul-17 4:40 
QuestionWhy can't I access a variable declared in derived class with the object of base class Pin
Member 132999538-Jul-17 7:02
Member 132999538-Jul-17 7:02 
Hi, Good Evening everyone

I have created two classes namely Shape, Rectangle with Draw() method in both the classes, Rectangle class is a deried class from Shape. I have declared a public variable in Rectangle called num and initialised a value to it.

In the main class I have created an object of type class in following manner.

Shape s = new Rectangle();

Now when I am trying to access num variable of rectangle class it gives error saying “ /Users/apple/Projects/Practice/Practice/Program.cs(33,33): Error CS1061: 'Shape' does not contain a definition for 'num' and no extension method 'num' accepting a first argument of type 'Shape' could be found (are you missing a using directive or an assembly reference?) (CS1061) (Practice)”

My Understanding : The statement new Rectangle(); creates an object of type Rectangle in the memory and its reference is stored in object s of type Shape. So the object s should have access to variable num defined in rectangle class. Please make me understand this concept why we can’t access num variable from Object of type Shape.

Pls find the attached screenshot.

modified 8-Jul-17 13:10pm.

AnswerRe: Why can't I access a variable declared in derived class with the object of base class Pin
PIEBALDconsult8-Jul-17 7:10
mvePIEBALDconsult8-Jul-17 7:10 
AnswerRe: Why can't I access a variable declared in derived class with the object of base class Pin
Dave Kreskowiak8-Jul-17 7:27
mveDave Kreskowiak8-Jul-17 7:27 

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.