c++编程新手错误分析(C++ programming novice error analysis).docVIP

  • 2
  • 0
  • 约9.41千字
  • 约 12页
  • 2017-08-16 发布于河南
  • 举报

c++编程新手错误分析(C++ programming novice error analysis).doc

c编程新手错误分析(Cprogrammingnoviceerroranalysis)

c++编程新手错误分析(C++ programming novice error analysis) (1) my program is all right, but it doesnt work. Think about your surroundings. Is there anyone who says that? If you had said, that stop, dont say these words, because these words will only show the speakers ignorance. Since the program is all right, then why is it wrong? (2) program = algorithm + data structure If we have just finished learning the C language, we say this is understandable, and it can be said to be correct. But if youre a programmer whos about to start working on C/C++ programming, then its a pity that this statement can only be a mistake, but theres another way in the world: Program = object + message The program = algorithm + data structure is set up only for process oriented language (C), whereas object oriented language (C++) can only be expressed as program = object + message. The traditional procedural programming language is process centric, algorithm driven, and object oriented programming languages are object centric and message driven. The message here is generalized, and object A calls the member function of object B, which can be treated as object A to send message to B. (3) compile the program and run it correctly. Running the right program is not always a good program. One of the things that programmers must keep in mind is that the programs they write are not only for themselves, but also for others to understand easily. Unfortunately, many programming novices do not have a clear grasp of the softwares structure. The concepts of the header file and the implementation file are ambiguous and the written program is poorly readable. C program adopts modular programming idea. It needs to divide a large software into a series of functional independent parts, and cooperate with each other to complete the system requirements. Module header file and implementation files, correct use of documents and files is wrong: Rule 1 header files (.H) is for the module interface declaration, including t

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档