C++ 教程入门:压缩包文件mySource

需积分: 5 0 下载量 118 浏览量 更新于2024-10-12 收藏 101KB ZIP 举报
资源摘要信息:"本资源是一份尝试性的C++教程。教程通过提供具体的代码示例和讲解,帮助学习者了解和掌握C++语言的基础知识和编程技巧。教程内容涵盖了C++语言的核心概念,如数据类型、控制结构、函数、数组和指针等,同时也可能包括面向对象编程的基本原理,例如类和对象、继承、多态以及模板等。由于资源标题包含'attempt',可以推测这是一份尝试性的教程,可能尚未完善,或者旨在征求反馈和建议。教程的文件名称列表仅提供了'mysource',这可能意味着教程中的示例代码或相关资源被命名为'mysource',但具体包含的内容和结构则需要进一步探索教程本身才能得知。" 由于缺乏具体的文件内容,以下知识点是根据标题和描述中所提及的内容进行推测,并结合C++语言的基础知识进行扩展: C++基础知识: - C++是一种静态类型、编译式、通用的编程语言。 - 它支持过程化、面向对象和泛型编程。 - C++继承了C语言的特性,并增加了面向对象编程的特性。 数据类型: - 基本数据类型:整型(int)、字符型(char)、浮点型(float、double)和布尔型(bool)。 - 派生数据类型:指针(*)、引用(&)、数组([])、结构体(struct)、联合体(union)和枚举(enum)。 - 构造复杂数据类型:类(class)、模板(template)等。 控制结构: - 条件控制:if-else语句、switch-case语句。 - 循环控制:for循环、while循环和do-while循环。 函数: - 函数是组织好的,可重复使用的代码块,用于执行单一或相关联任务。 - 函数声明、定义和调用是C++编程的核心组成部分。 数组和指针: - 数组是一组数据的集合,可以是一维或多维的。 - 指针是变量,其值为内存中的地址,指针允许对内存地址进行操作。 面向对象编程: - 类(class)是C++实现面向对象编程的核心,它封装了数据和操作数据的方法。 - 对象(object)是类的实例,可以包含数据成员和成员函数。 - 继承(inheritance)允许一个类派生出新的类,继承基类的属性和行为。 - 多态(polymorphism)允许不同类的对象对同一消息做出响应,实现接口的多种形态。 - 模板(template)是一种泛型编程的概念,允许创建可重用的函数和类,用于处理不同数据类型的集合。 在学习C++的过程中,理解这些知识点对于编写有效和高效的代码至关重要。初学者应该通过实践和编写代码来巩固理论知识,并逐步深入到更复杂的概念中去。对于面向对象编程的高级特性,比如虚函数、纯虚函数、抽象类、构造函数和析构函数等,也应当在后续的学习中加以掌握。这份教程可能会包含上述所有知识点的介绍和讲解,以及相应的示例代码,从而帮助学习者从基础入门,逐步提升到中高级水平。

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: com.ncusoft.weatherchina, PID: 32468 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$4.done(AsyncTask.java:415) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381) at java.util.concurrent.FutureTask.setException(FutureTask.java:250) at java.util.concurrent.FutureTask.run(FutureTask.java:269) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:121) at org.json.JSONTokener.nextValue(JSONTokener.java:98) at org.json.JSONObject.<init>(JSONObject.java:168) at org.json.JSONObject.<init>(JSONObject.java:185) at com.ncusoft.weatherchina.RemoteDataParser.parseJsonToWeather(RemoteDataParser.java:52) at com.ncusoft.weatherchina.RemoteDataParser.parseWeatherData(RemoteDataParser.java:20) at com.ncusoft.weatherchina.MainActivity$weatherTask.doInBackground(MainActivity.java:48) at com.ncusoft.weatherchina.MainActivity$weatherTask.doInBackground(MainActivity.java:36) at android.os.AsyncTask$3.call(AsyncTask.java:394) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)  at java.lang.Thread.run(Thread.java:1012)  W/ft.weatherchina: Cleared Reference was only reachable from finalizer (only reported once) W/System: A resource failed to call close.

2023-05-17 上传

Process: com.example.dzy, PID: 26008 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dzy/com.example.dzy.NavigationActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at com.example.dzy.Fragment_1.<init>(Fragment_1.java:44) at com.example.dzy.NavigationActivity.initTab(NavigationActivity.java:39) at com.example.dzy.NavigationActivity.onCreate(NavigationActivity.java:27) at android.app.Activity.performCreate(Activity.java:7802) at android.app.Activity.performCreate(Activity.java:7791) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)

2023-06-01 上传

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.hjschoolhelper210301201_1, PID: 13135 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference at com.example.hjschoolhelper210301201_1.ClubinfoAdpter.getView(ClubinfoAdpter.java:44) at android.widget.AbsListView.obtainView(AbsListView.java:2458) at android.widget.ListView.makeAndAddView(ListView.java:2067) at android.widget.ListView.fillDown(ListView.java:793) at android.widget.ListView.fillFromTop(ListView.java:855) at android.widget.ListView.layoutChildren(ListView.java:1838) at android.widget.AbsListView.onLayout(AbsListView.java:2255) at android.view.View.layout(View.java:23693) at android.view.ViewGroup.layout(ViewGroup.java:6413) at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1855) at android.view.View.layout(View.java:23693) at android.view.ViewGroup.layout(ViewGroup.java:6413) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332) at android.widget.FrameLayout.onLayout(FrameLayout.java:270) at android.view.View.layout(View.java:23693) at android.view.ViewGroup.layout(ViewGroup.java:6413) at androidx.appcompat.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:536) at android.view.View.layout(View.java:23693) at android.view.ViewGroup.layout(ViewGroup.java:6413) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332) at android.widget.FrameLayout.onLayout(FrameLayout.java:270) at android.view.View.layout(View.java:23693) at android.view.ViewGroup.layout(ViewGroup.java:6413) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1891) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1729) at android.widget.LinearLayout.onLayout(LinearLayout.java:1638) at android.view.View.layout(View.java:23693) at android.view.ViewGroup.layout(ViewGroup.java:6413) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332) at android.widget.FrameLayout.onLayout(FrameLayout.java:270) at com.android.internal.policy.DecorView.onLayout(DecorView.java:799) at android.view.View.layout(View.java:23693) at android.view.ViewGroup.layout(ViewGroup.java:6413) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3999) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3372) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2328) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9087) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239) at android.view.Choreographer.doCallbacks(Choreographer.java:899) at android.view.Choreographer.doFrame(Choreographer.java:832) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7872) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

2023-05-17 上传

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { act=inline-data (has extras) }} to activity {com.example.camerax_final/com.example.camerax_final.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:4845) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference at com.example.camerax_final.MainActivity.onActivityResult(MainActivity.java:87) at android.app.Activity.dispatchActivityResult(Activity.java:8110) at android.app.ActivityThread.deliverResults(ActivityThread.java:4838) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)  at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:214)  at android.app.ActivityThread.main(ActivityThread.java:7356)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 

2023-05-25 上传
2023-06-09 上传