我从很多情况下得到了这个问题的想法,我不明白这个人在说什么,什么时候别人不理解我.
因此,"智能"解决方案是说一种计算机语言.:)
我感兴趣的是编程语言可以接近(英语)自然语言.当我说近,我的意思不仅仅是使用单词和句子,而是能够"做"自然语言可以"做"的事情和"做",我的意思是它可以被使用(以非常有限的方式)作为自然语言的替代品.
我知道这是不可能的(是吗?)但我认为这可能很有趣.
嗯......就是这样.
我需要一些简单而可靠的(不必有花哨的功能-我需要写入和读取Excel单元格的文字和数字)
是的,我想要一个示例"Hello Cell"代码 ......
您有什么推荐的吗?
您能否推荐我应该阅读/学习什么才能在C中制作组织良好的代码?
我想要学习的一件事是在.h和.c文件中拆分项目的原则,在哪里和为什么,变量命名,何时使用全局变量...
我对处理这个特定问题的书籍和文章很感兴趣.
我有一个非常奇怪的问题,因为我不可能发送代码,我会尝试解释.
这更像是哲学问题 - 我希望有人有时间/知识来思考这个问题.
1)我的project.cpp看起来完全像这样:
#include <pthread.h>
#include <unistd.h>
pthread_t pplayer_thread;
void *play(void*);
int main(int argc, char **argv) {
pthread_create(&pplayer_thread, NULL, play_cb, NULL);
usleep(5000000);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
2)pplayer.cpp看起来像这样:
...
void *play_cb(void *arg) {
// this starts movie using gstreamer and exits thread
}
...
Run Code Online (Sandbox Code Playgroud)
3)not_executed _from_main.cpp看起来像这样:
...
extern MyClass *myObj; // this is included from .h file
...
MyClass *myObj = NULL;
...
some_function() {
...
myObj = MyClass::createNew(args);
...
}
...
Run Code Online (Sandbox Code Playgroud)
这些都与各种其他图书馆和大量垃圾联系在一起,但这基本上是重要的.
- > 问题: …
当我运行此代码时:
#include <stdio.h>
typedef struct _Food
{
char name [128];
} Food;
int
main (int argc, char **argv)
{
Food *food;
food = (Food*) malloc (sizeof (Food));
snprintf (food->name, 128, "%s", "Corn");
free (food);
printf ("%d\n", sizeof *food);
printf ("%s\n", food->name);
}
Run Code Online (Sandbox Code Playgroud)
我还是得到的
128
Corn
Run Code Online (Sandbox Code Playgroud)
虽然我已经解放了食物.为什么是这样?记忆真的被释放了吗?