C有课吗? [英] Does C have classes?

查看:71
本文介绍了C有课吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,你可以叫我一个菜鸟,但我感到很困惑。

Okay, you may call me a noob but I'm realling confused.

我的前同学付钱给我用C编写程序。她给了我任务它说:等等等等,至少要做成两个类,至少要写一个构造函数,至少要重写一个方法。

My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least two classes, write at least one constructor and rewrite at least one method" it says that word by word.

然后我告诉她这是C ++而不是C,她说但是我们正在学习C

And then I told her "this is C++ not C" she said "but we're learning C"

我忽略了它,并用c ++编写了程序并发送给她,因为我以为她不知道自己在说什么。她说:它不适用于代码块,而wtf是cout<<。然后她给我发了他们编写的代码,而不是cout和cin,而是printf和scanf。因此,我用printf和scanf重写了程序,她仍然说代码块抛出错误(我仍然按照任务要求离开类)。

I ignored it and wrote the program in c++ and sent to her as I thought she didn't know what she was talking about. She said "it doesn't work on code blocks, and wtf is cout <<" and then she sent me a chunk of code that they write and instead of cout and cin there was printf and scanf. It had to be C. So, I rewrote the program with printf and scanf and she still says codeblocks throw errors (I still left classes as task demanded).

C有课程吗?还是有误会或什么?

推荐答案

不,C没有类。也就是说,有多种方法可以在C语言中模拟面向对象的编程-快速的Google搜索应会产生一些有用的结果。

No, C doesn't have classes. That said, there are ways of simulating object-oriented programming in C - a quick Google search should yield some useful results.

这篇关于C有课吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆