用于无线传感器网络的 C++

标签 c++ c networking wireless sensors

类似于:Why are RTOS only coded in C ,但是:

除了关于 C++ 的无数神话之外,为什么它不像 C/nesC (TinyOS) 那样被广泛用于 WSN?了解 C++ 可用于 Simulating Wireless Sensor Networks with OMNeT++很难不认为它也可以用于实时嵌入式系统,因为C是完成事件处理。

我不想开始一场 C++ 比 C 更好的争论,但有足够的证据表明整个 C 比 C++ 更快、更通用完全是一个神话。看看:

C vs. C++突出以下几点的论文:

- C++ is slower than C: Wrong! Many C programs are valid C++ programs as well - and such a C program should run at identical speed when translated with either the C and with the C++ compiler.
- C++ specific features give overhead: Wrong! The so-called overhead introduced by certain C++ specific features (such as virtual function calls or exceptions), is comparable to the overhead you yourself would introduce should you choose to go thru the pain it would be to implement a similar feature in C.
- C++ is object oriented: Wrong! The C++ language contains some language extentions over C, that make object oriented programming and generic programming more convenient. C++ does not force object oriented design anywhere - it merely allows for it if the programmer deems OO feasible. C allows for object oriented programming as well, C++ only makes it simpler and less error prone.

Why are you still using C

最佳答案

我相信以下问题的答案适用于此。

Is there any reason to use C instead of C++ for embedded development?

关于用于无线传感器网络的 C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2274686/

相关文章:

c++ - 将一个函数作为参数传递给另一个函数的不同方法有什么区别?

c++ - 使用 qFromBigEndian 编译错误

c++ - C++ 中独立于操作系统的线程?

c++ - IP 标志的 Don't Fragment Bit 在哪里使用?

java - Android 中的通用网络管理器

c++ - 转换在 Visual Studio 2015 中不明确,但在 clang 中没有

c++ - 何时真正使用访客模式

c - 使用 net-snmp C API 设置值时出现问题

c - 使用 c_api.h 执行使用 tensorflow.contrib.resampler 的卡住 tensorflow 图

ios - 是否可以在获取 header 之后、开始获取数据之前中断 NSURLSessionDownloadTask?