这里发生了什么? [英] What is going on here?
问题描述
我已经编程了一段时间,我在
之前看过这个语法,我从一本书中复制了这个,但这本书并没有解释会发生什么。
在这里。
级引擎{
受保护:
静态引擎* pengine;
比以后:
if(initialize(hin)){
if(!engine :: gengine() - > init(CmdShow )){return false;}
while(TRUE){
引擎对象有自己的类型作为指针然后它被称为
由上面的命令。我相信这是OO编程,但我不会理解发生了什么以及我会写什么小程序或
项目tha = t会帮助我学习这个。
JoeC写道:
我已经编程了一段时间我在
之前看过这个语法,我从一本书中复制了这个,但这本书并没有解释这里有什么东西
。
>
级引擎{
受保护:
静态引擎* pengine;
多么不幸名字,读起来像企鹅!
比以后:
if(initialize(hin)){
if(!engine :: gengine() - > init(CmdShow)){return false;}
这将是语法错误,你有宣称pengine作为一个指针
,在这里你试图调用它上面的operation()。
while(TRUE){
为什么将伪布尔与bool混合使用?
>
引擎对象有自己的作为一个指针然后它被上面的命令称为
。我相信这是OO编程,但我不会理解发生了什么以及我会写什么小程序或
项目tha = t会帮助我学习这个。
具体你不明白什么?我不认为你的问题是与bO编程有关,更多的是不理解的情况
一些C ++基础知识。您正在学习哪本书?
-
Ian Collins。
文章< ; 5h ************* @ mid.individual.net> ;, ia ****** @ hotmail.com
说...
[...]
< blockquote class =post_quotes>
if(initialize(hin)){
if(!engine :: gengine() - > init(CmdShow)){return false;}
这是一个语法错误,你声明了pengine作为指针
,在这里你试图调用它上面的operation()。
我根本没看到它在哪里用过pengine。我看到的唯一使用operator()
的是genngine()返回 - 而且他还没有向我们展示
。
-
后来,
杰瑞。
宇宙是它的一个虚构自己的想象力。
Jerry Coffin写道:
文章< 5h ******* ******@mid.individual.net>, ia******@hotmail.com < br $> b $ b说...
[...]
>> if(initialize(hin)){
if(!engine :: gengine() - > init(CmdShow)){return false;}
这将是一个语法错误,您已声明pengine作为指针
在这里你试图调用它上面的operation()。
我根本没看到它在哪里用过pengine。我看到的唯一使用operator()
的是genngine()返回 - 而且他还没有向我们展示
。
糟糕,看到它是一个无用的名字!
-
Ian Collins。
I have been programming for a while and I have seen this syntax before
and I copied this from a book but the book didn''t explain what is going
on here.
class engine{
protected:
static engine* pengine;
Than later:
if(initialize(hin)){
if(!engine::gengine()->init(CmdShow)){return false;}
while(TRUE){
The engine object has its own kind as a pointer then later it is called
by the above command. I do believe this is OO programming but I don''t
understand what is going on and what small programs I would write or
projects tha=t would help me learn this.
JoeC wrote:I have been programming for a while and I have seen this syntax before
and I copied this from a book but the book didn''t explain what is going
on here.
class engine{
protected:
static engine* pengine;
What an unfortunate name, reads like penguin!
Than later:
if(initialize(hin)){
if(!engine::gengine()->init(CmdShow)){return false;}This would be a syntax error, you have declared "pengine" as a pointer
and here you are attempting to invoke operation () on it.
while(TRUE){
Why mix pseudo booleans with bool?
>
The engine object has its own kind as a pointer then later it is called
by the above command. I do believe this is OO programming but I don''t
understand what is going on and what small programs I would write or
projects tha=t would help me learn this.What specifically don''t you understand? I don''t think your problem is
anything to do with OO programming, more an case of not understanding
some C++ basics. Which book are you learning from?
--
Ian Collins.
In article <5h*************@mid.individual.net>, ia******@hotmail.com
says...
[ ... ]
if(initialize(hin)){
if(!engine::gengine()->init(CmdShow)){return false;}
This would be a syntax error, you have declared "pengine" as a pointer
and here you are attempting to invoke operation () on it.I don''t see where it''s used pengine at all. The only use of operator()
that I see is on whatever genengine() returns -- and he hasn''t shown us
that at all.
--
Later,
Jerry.
The universe is a figment of its own imagination.
Jerry Coffin wrote:In article <5h*************@mid.individual.net>, ia******@hotmail.com
says...
[ ... ]
>> if(initialize(hin)){
if(!engine::gengine()->init(CmdShow)){return false;}This would be a syntax error, you have declared "pengine" as a pointer
and here you are attempting to invoke operation () on it.
I don''t see where it''s used pengine at all. The only use of operator()
that I see is on whatever genengine() returns -- and he hasn''t shown us
that at all.
Oops, see it was an unhelpful name!
--
Ian Collins.
这篇关于这里发生了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!