definition

Why class { int i; }; is not fully standard-conformant?

谁说我不能喝 提交于 2019-11-27 11:54:24
问题 This is a follow-up question. In the previous question, @JohannesSchaub-litb said that the following code is not fully standard-conformant: class { int i; }; //unnamed-class definition. § 9/1 allows this! and then he added, while it is grammatically valid, it breaks the rule that such a class must declare at least one name into its enclosing scope. I couldn't really understand this. What name is he talking about? Could anyone elaborate on this further (preferably quoting the Standard)? 回答1:

Is is a good practice to put the definition of C++ classes into the header file?

我只是一个虾纸丫 提交于 2019-11-27 11:07:52
When we design classes in Java, Vala, or C# we put the definition and declaration in the same source file. But in C++ it is traditionally preferred to separate the definition and declaration in two or more files. What happens if I just use a header file and put everything into it, like Java? Is there a performance penalty or something? The answer depends on what kind of class you're creating. C++'s compilation model dates back to the days of C, and so its method of importing data from one source file into another is comparatively primitive. The #include directive literally copies the contents

What is the meaning and reasoning behind the Open/Closed Principle?

无人久伴 提交于 2019-11-27 11:07:11
The Open/Closed Principle states that software entities (classes, modules, etc.) should be open for extension, but closed for modification. What does this mean, and why is it an important principle of good object-oriented design? Specifically, it is about a "Holy Grail" of design in OOP of making an entity extensible enough (through its individual design or through its participation in the architecture) to support future unforseen changes without rewriting its code (and sometimes even without re-compiling **). Some ways to do this include Polymorphism/Inheritance, Composition, Inversion of

What is “over-engineering” as applied to software? [closed]

半城伤御伤魂 提交于 2019-11-27 10:32:57
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I wonder what would be a good definition of term "over-engineering" as applied to software development. The expression seems to be used a lot during software design discussions often in conjunction with "excessive future-proofing" and it would be nice to nail down a more

Software Design vs. Software Architecture [closed]

纵饮孤独 提交于 2019-11-27 09:55:20
Could someone explain the difference between Software Design and Software Architecture? More specifically; if you tell someone to present you the 'design' - what would you expect them to present? Same goes for 'architecture'. My current understanding is: Design: UML diagram/flow chart/simple wireframes (for UI) for a specific module/part of the system Architecture: component diagram (showing how the different modules of the system communicates with each other and other systems), what language is to be used, patterns...? Correct me if I'm wrong. I have referred Wikipedia has articles on http:/

Programming Definitions: What exactly is 'Building'.

。_饼干妹妹 提交于 2019-11-27 09:25:50
问题 What does it mean to build a solution/project/program? I want to make sure I have my definitions correct (so I don't sound like a idiot when conversing). In IDE's, you can (correct me if I'm wrong) compile source-code/programming-code into computer-readable machine code. You can debug a program, which is basically stepping through the program and looking for errors. But what exactly does building a program do? In VS I'm aware that when you build a program it produces an executable file in a

Java: int[] array vs int array[] [duplicate]

两盒软妹~` 提交于 2019-11-27 09:23:48
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Difference between int[] array and int array[] Is there a difference between int[] array = new int[10]; and int array[] = new int[10]; ? Both do work, and the result is exactly the same. Which one is quicker or better? Is there a style guide which recommends one? 回答1: Both are equivalent. Take a look at the following: int[] array; // is equivalent to int array[]; int var, array[]; // is equivalent to int var;

What is marshalling? What is happening when something is “marshalled?”

别等时光非礼了梦想. 提交于 2019-11-27 09:18:58
问题 I know this question has been asked, at least here. But there wasn't a satisfactory answer, at least not to me. There is a lot of talk about marshalling as regards interoperating with unmanaged code, but what about marshalling from one thread to another, as we have to do in .NET sometimes. This makes me ask, what is marshalling, really? When you give a definition of marshalling, how would you define it so that it is explaining the case of interoperability, as well as the cases where you are

Is there any use for local function declarations?

試著忘記壹切 提交于 2019-11-27 08:38:46
Most C++ programmers like me have made the following mistake at some point: class C { /*...*/ }; int main() { C c(); // declares a function c taking no arguments returning a C, // not, as intended by most, an object c of type C initialized // using the default constructor. c.foo(); // compiler complains here. //... } Now while the error is pretty obvious once you know it I was wondering if there is any sensible use for this kind of local function declaration except that you can do it -- especially since there is no way to define such a local function in the same block; you have to define it

Hexadecimal to decimal

我的梦境 提交于 2019-11-27 08:25:34
问题 I have to convert a hexadecimal number to decimal, but don't know how. In the AutoIt documentation (pictured below) some constants (being assigned hexadecimal values) are defined: 0x00200000 hexadecimal (underlined in image) equals 8192 decimal (this is the true conversion). But convertors return 2097152 . I have to convert another hex value ( 0x00000200 ), but convertors get it wrong. How to correctly convert it? When I use the definition $WS_EX_CLIENTEDGE (or a hexadecimal value), it doesn