Re: Type conversions in D

2017-02-21 Thread Jean Cesar via Digitalmars-d-learn
On Tuesday, 21 February 2017 at 22:09:11 UTC, Seb wrote: On Tuesday, 21 February 2017 at 21:39:37 UTC, Jean Cesar wrote: I once saw an article that talked about type conversions using the D language. Type convert integer to exadecimal, binary, but I'm thinking of writing an article in my

Type conversions in D

2017-02-21 Thread Jean Cesar via Digitalmars-d-learn
I once saw an article that talked about type conversions using the D language. Type convert integer to exadecimal, binary, but I'm thinking of writing an article in my blog but I do not find the site I saw on to know more information of the same type as I did below. void main() { int

Re: Converting multiple inheritance code into C ++ for D language

2017-02-18 Thread Jean Cesar via Digitalmars-d-learn
On Saturday, 18 February 2017 at 19:45:45 UTC, biozic wrote: On Saturday, 18 February 2017 at 19:05:14 UTC, Jean Cesar wrote: This is exactly what I want this code I did to understand how would apply multiple inheritance in D, C # also process using interfaces but the difference from C # to D

Re: Converting multiple inheritance code into C ++ for D language

2017-02-18 Thread Jean Cesar via Digitalmars-d-learn
On Saturday, 18 February 2017 at 16:27:51 UTC, biozic wrote: On Saturday, 18 February 2017 at 12:56:51 UTC, wiki wrote: On Saturday, 18 February 2017 at 09:33:25 UTC, biozic wrote: A mixin can be used to provide an base implementation for the methods of an interface, along with data members,

Re: Converting multiple inheritance code into C ++ for D language

2017-02-17 Thread Jean Cesar via Digitalmars-d-learn
On Friday, 17 February 2017 at 23:31:41 UTC, Adam D. Ruppe wrote: On Friday, 17 February 2017 at 23:11:25 UTC, Jean Cesar wrote: so I changed the code to use interface but how would I do so I could use the constructor in the same way as such a C ++ code? Interfaces + mixin templates give you

Converting multiple inheritance code into C ++ for D language

2017-02-17 Thread Jean Cesar via Digitalmars-d-learn
import std.stdio; import std.string; I've been reading a bit about multi-inheritance in D, but I have to use interface like C # to use multiple inheritance, but I have the code in C ++ that I've been testing to understand how it would be possible to implement multi-inheritance constructor

Re: Error reading char in read

2017-02-17 Thread Jean Cesar via Digitalmars-d-learn
On Friday, 17 February 2017 at 21:34:16 UTC, ag0aep6g wrote: On 02/17/2017 09:24 PM, Ali Çehreli wrote: It's the Unicode character "U+FFFD REPLACEMENT CHARACTER", which is represented by 2 chars in D. It takes 3 `char`s to represent U+FFFD: void main() { import std.stdio;

Error reading char in read

2017-02-17 Thread Jean Cesar via Digitalmars-d-learn
import std.stdio; import std.string; auto read(C)(ref C c, char[80] message) if (isSomeChar!C) { writef("\n\t%s: ", message); c = strip(readf()); readf(" %s", ); return c; } void main() { char[50] message; read(message,"Digite Seu nome: "); writeln(message); } estou

Re: User imput string int and float[DOUBT]

2017-02-16 Thread Jean Cesar via Digitalmars-d-learn
On Thursday, 16 February 2017 at 22:44:58 UTC, Ali Çehreli wrote: On 02/16/2017 02:05 PM, Jean Cesar wrote: > So I used get methods and sets only as initial pattern to netender the > functioning of the language in relation to some concepts of the same Makes sense... > how to leave a very

Re: User imput string int and float[DOUBT]

2017-02-16 Thread Jean Cesar via Digitalmars-d-learn
On Thursday, 16 February 2017 at 02:17:49 UTC, Ali Çehreli wrote: On 02/15/2017 05:49 PM, Jean Cesar wrote: > So I'm a beginner in this language and have very little time I started > I'm interested in apprehending concepts of object orientation > polymorphism inheritance, multiple inheritance

How to use D-language polymorphism?

2017-02-16 Thread Jean Cesar via Digitalmars-d-learn
I have the following code in c++ using polymorphism how would I convert D-language polymorphism? #include #include class Mamifero { protected: int idade; public: Mamifero(){} ~Mamifero(){} virtual void somMamifero() const { std::cout<<"\n\tSom de mamifero.\n"; } };

Re: User imput string int and float[DOUBT]

2017-02-15 Thread Jean Cesar via Digitalmars-d-learn
On Wednesday, 15 February 2017 at 23:40:41 UTC, Ali Çehreli wrote: On 02/15/2017 03:20 PM, Jean Cesar wrote: How do I make a class person where I use set and get methods to imput the user type: I have some information here: http://ddili.org/ders/d.en/input.html You should also know how

User imput string int and float[DOUBT]

2017-02-15 Thread Jean Cesar via Digitalmars-d-learn
How do I make a class person where I use set and get methods to imput the user type: Import std.stdio; class person { private: string name, address; int age; float height; public: void setNome() { write("Enter Your Name:"); // the problem is here how am I going to read the