阅读背景:

对象在switch语句中的作用域

来源:互联网 

I trying to make a program where you have a menu to leave comments, view comments, and create an account. The I made the menu to be a switch statement. In most of the cases I need a "user object", but that is created in case1 and it's scope is only in to case1. I used a "User pointer" so I can use it in the other cases. I have the switch statement so the it runs until the user exits. When I add the pointer in case1 and ran the program it crashed. "My question is there another way to have an "user object created in case1 " be accessible to all the other cases ?? I trying to make a program where you have a men




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: