MᏫᎻᎯᎷᎷᎬᎠ
Wow Don't drink water cuz someone told you that
klimi
hm
klimi
bitwise operators are useful
MᏫᎻᎯᎷᎷᎬᎠ
I googled
MᏫᎻᎯᎷᎷᎬᎠ
And they said Cuz they don't want to you type Things like this template<class T> T t;
MᏫᎻᎯᎷᎷᎬᎠ
Thanks
Anonymous
Can I ask u a question? How come when I use file functions as fdcanf(), it increments every time the pointer position?
klimi
C++ is awesome
Anonymous
Mihail
Can I ask u a question? How come when I use file functions as fdcanf(), it increments every time the pointer position?
Why shouldn't it? After all it is also a function it can do whatever it wants
Anonymous
Why shouldn't it? After all it is also a function it can do whatever it wants
That's not what I mean. Ok, I don't exactly know how os' work, but when I "create" a file in c, it gives me the FD. Alright, how should the FD point to that file?
klimi
🤔
It is
Anonymous
It is
Yeah
Mat
Hey :D
Anonymous
What do you mean?
When I do fopen(), it gives me the file descriptor
Anonymous
Not the pointer to the file
Mat
Sort of
klimi
Here is my problem
Mat
When I do fopen(), it gives me the file descriptor
It gives you a pointer to the stream
Anonymous
It gives you a pointer to the stream
Oh... Why don't I save it in a pointer variable but in a normal variable?
Mat
This will help you
Anonymous
Define "normal"
Int a; //normal Int *a; // pointer
Anonymous
Ok no it doesn't
Anonymous
Thank you ahahahah
Mat
No problem :)
Anonymous
So it is possible to increment pointers value passed by argument?
Mat
So it is possible to increment pointers value passed by argument?
If you pass pointers in a fun input, you can access to the real variable they're pointing to
Anonymous
If you pass pointers in a fun input, you can access to the real variable they're pointing to
But can I do like: ... Int *p = 0x/005acb09 FuncionThatIncrementPointerByTwo(p); Printf(&p,p); // prints 0x/005acb11
Mat
But can I do like: ... Int *p = 0x/005acb09 FuncionThatIncrementPointerByTwo(p); Printf(&p,p); // prints 0x/005acb11
It will print 2 different values🤔 Let's say the Format part of printf is implied. You'll print p's address and p
Mat
Nope
Mat
Sorry 😆p is copied, you need to give the address of p to the fun to print p+2
Mat
When you give to a fun an input, it is copied in it. So you copy addresses to be able to write on the real variable. But the address is copied as a variable (they're variables) so to finally increment it you need to pass its address
Mat
If it's from 0 to 11 it should be 12
Mat
Don't know right now 😕
Anonymous
Damn i didn't know dat.
BinaryByter
lol this is some premium feature of Cpp
BinaryByter
thats how you can define operators for classes
BinaryByter
like classa + classb
Alchemist
/saved
Alchemist
/get cppbook
Anonymous
Hello guys, am new to programming codes, kindly i need your help especially for c#
Badugar
Take a look at the title of the group. Is C# mentioned there ?
Ariana
id say that cs is still fine
ehhhhhhhhhhhhhvgjbyjbg
Mat
Yes C is mentioned there
C/C++. Where is C#?
Mat
But we'll help you with C and Cpp :)
Ariana
<orDb>
Anonymous
C/C++. Where is C#?
Sorry i meant C not C# just made an error
Mat
Yes C is mentioned there
The group will help you. Don't start PM with random folks
Mat
Sorry i meant C not C# just made an error
Just to warn you: I'll not answer to your private messages :)
Anonymous
Just to warn you: I'll not answer to your private messages :)
Am sorry, but would like to get assisted since am just a beginner and would like to know the coding as fast as possible
BinaryByter
As fast as possible is bad
BinaryByter
imagine watching a lecture at x8 speed
Anonymous
As fast as possible is bad
Thanks, will learn it slowly
BinaryByter
but at an appropriate pace
Anonymous
#findprojects
Anonymous
#best-book
Anonymous
/get best-book
Anonymous
#cpp
Anonymous
Which is the best application one can use for C programming?
S.
#include <cstdio> struct Base { virtual void foo() = 0; }; void Base::foo() { puts("Base::foo"); } struct Derive: Base { virtual void foo() override; }; void Derive::foo() { this->Base::foo(); puts("Derive::foo"); } int main() { Base *base = new Derive{}; base->foo(); } Hi guys. I just learnt the pure virtual function can be defined outside a class. But, is there any scenario for this usage?
S.
My guess is, it's just for alleviating the compiler's burden (since it's difficult to check
Neon
Okh
Anonymous
why many demo named functions with foo,foo means what?
S.
For such questions, please consult wikipedia first: https://en.wikipedia.org/wiki/Foobar
Anonymous
then why not use func or other meaningful string as placehoder
S.
See the etymology part
Anonymous
then why not use func or other meaningful string as placehoder
Well, see the wikipedia articel, and: Why should I use meaningful strings that will always be different everywhere if the code is only a few lines long
Anonymous
Anonymous
3q
Anonymous
thx