Anonymous
is clion open source?
Why do you care?
Coder Mayk
Hi How can I do I want to write "X" in each line of the matrix
Nils
interpreter.cpp: https://hastebin.com/ewovicaqin.cpp module_builtin.cpp: https://hastebin.com/aqopenobem.cpp module_builtin.h: https://hastebin.com/ajexonabuk.cpp Error message: https://hastebin.com/mawafezaku.rb Do you have any idea why this happend? I declared the function as static but it says it is a non-static function
Nils
Oh and interpreter::modules is: std::map<const char *, rtypes::pilcommand> modules; and rtypes::pilcommand is: typedef std::string (*pilcommand)(std::list<std::string>);
Anonymous
Please
Zel
Code blocks is starting to show its age
Zel
Or straight up classes
Anonymous
Code blocks is starting to show its age
Code blocks is ... a bad example of ide
Nils
Use type aliases
how would I write my current typedef as type alias?
Anonymous
https://gist.github.com/niansa/934d3cab059474c8f1e03cd6b6e599ce
run_command is not a static member function
Nils
static std::string module_builtin::cmd_print
Anonymous
It is not
Nils
It is not
I fixed it and it still fails
Nils
with exactly the same error
Anonymous
static std::string module_builtin::cmd_print
So what? 1) It is in cpp-file 2) it's not "run_command"
Nils
I fixed it and it still fails
(I updated the gist)
Anonymous
Anyone using wxsmit in c++
Nils
Could you please explain further?
Nils
It is in a .cpp file…
Nils
and it is run_command
Anonymous
Your error about run_command member function It is not static
Nils
Your error about run_command member function It is not static
I feel dumb… So that do I have to change?
Anonymous
You cannot cast member function pointer to just function pointer
Nils
🤔
Anonymous
You need to store std::function
Nils
aaah.
Nils
You need to store std::function
So… std::map<std::string, std::function> commands;?
Anonymous
how would I write my current typedef as type alias?
using name = std::string(*)(std::list<std::string>);
Nils
using name = std::string(*)(std::list<std::string>);
In at exactly the same place that my current typedef ist?
Nils
with the same usage?
Nils
but then pilcommand is not defined anymore
Anonymous
std::map<std::string, std::function<std::string(std::list<std::string>)>>
Jussi
Whoa
Anonymous
I don't understand you Even if run_command were free function, you cannot cast it to pilcommand
Рома
Hi guys, is anyone programming in QT?
Рома
Anonymous
cast? free function??? Damn I need to learn more
You are trying to do something that is not possible
Nils
oh…
Nils
:-///
Anonymous
Just ask someone to do it
Anonymous
In a way it can be done
Anonymous
I'm not in a mood to do it and explain it rn
Anonymous
Sorry
MᏫᎻᎯᎷᎷᎬᎠ
Hi, can I store a class inside a list?
A class is a schema or a description of data and how they are related to each other and specify its operations So it's not something can be stored because it's just a schema
Nils
okay…
MᏫᎻᎯᎷᎷᎬᎠ
Good
Nils
It is so frustrating trying to solve it in another way
Anonymous
#include <stdio.h> #define SPACE ' ' //SPACE表示 空格 int main(void) { char ch; ch = getchar(); //读取一个字符 while (ch != '\n') //当一行未结束时 { if (ch == SPACE) //留下空格 putchar(ch); //该字符不变 else putchar(ch + 1); //改变其他字符 ch = getchar(); //获取下一个字符,这是什么意思 } putchar(ch); //打印换行符号,这是什么意思 return 0; }
Leo
He is asking what does getchar and putchar do in the code comment.
klimi
chinese is so cool! 😆but yes, english group
Leo
😂😂
Anonymous
In this code, I can understand ch = gechar () as scanf ("% c", & ch) and putchar (ch) as printf ("% c", ch)
Leo
But with a small difference
Anonymous
That's correct
In this code, if I enter only one character 'A', what is the meaning of ch = getchar ()?
Leo
ch will be A
......
Any body can give me f**k
Anonymous
I only know: if you don't write ch = getchar (); then this loop will be abnormal
Anonymous
Self-study c is a bit difficult
Leo
I only know: if you don't write ch = getchar (); then this loop will be abnormal
Cause your loop only process a char at a time, if you don't run ch = Getchar() the value of ch is not changed, and the exit condition (ch==\n) will always be false.
Leo
Self-study c is a bit difficult
https://b23.tv/BV1Bx411u7qY/p1 This MOOC by ZJU is good for Chinese beginners.
Anonymous
thanks
Anonymous
I use C Prime plus