Ludovic 'Archivist'
Ha no, I mixed users
Ludovic 'Archivist'
any link tutoria on it?
https://pocoproject.org/docs/ZipUserGuide.html
Thespartann
Ludovic 'Archivist'
Thespartann
Ew
Why?
Mihail
Why?
It's bad
Thespartann
Thespartann
Vincenzo
hello, i have a problem with pointer passed as arguments in a function: i would like to make a function that knows if i passed a pointer to it or not: //g++ 5.4.0 #include <iostream> void test (int *p = NULL){ if (p){ std::cout << "passed\n"; } else { std::cout << "not passed\n"; } } int *my_p; int main() { test(my_p); test(); }both will output "not passed" because i didn't inizialize my pointers is there a way without allocating memory to my_p to let the function know that i passed an argument to it?
Oleh
1) Use nullptr instead of NULL. 2) I think the only way is to write function overloading
Anonymous
you could also pass a pointer to the variable
Anonymous
so instead of my_p you will pass &my_p
Anonymous
and then you test in there if it is a valid address or NULL
Vincenzo
so instead of my_p you will pass &my_p
this seems to work: //g++ 5.4.0 #include <iostream> void test (int **p = nullptr){ if (p){ std::cout << "passed\n"; } else { std::cout << "not passed\n"; } } int *my_p; int main() { test(&my_p); test(); }
Vincenzo
output: passed not passed
Vincenzo
could i ask you if you think this is a good approach and a good solution? also should i use if (p) or better: if (p!=nullptr)? i guess the second one
olli
could i ask you if you think this is a good approach and a good solution? also should i use if (p) or better: if (p!=nullptr)? i guess the second one
Whether it is a good solution depends on the problem you are trying to solve. Do you want to change where the pointer is pointing to or do you want to change its value? Regarding your second question I prefer if(pointer) since it's easier to read and write (imho)
Vincenzo
I m facing some errors which i am trying to solve in my code but for now it seems that i passed the pointer correctly
olli
I would like to change where the pointer is pointing
In this case you need to pass "pointer to pointer"
Anonymous
What is difference between function and pointer in c
MᏫᎻᎯᎷᎷᎬᎠ
I don't know
Mihail
What is difference between function and pointer in c
what's the similarity between a function and a pointer?
Prometheus
A function is a grouping of code that gets called for a specific purpose. A pointer tells the program to look in a specific storage location for data. A pointer keeps you from having to pass the data itself.
Sanjay Tharagesh
both pointer and functions are different. Pointer is variable that points to some memory location in the disk. Where function is collection of statements which does some operations. Functions are defined when a same kind of operation to be performed on several data. Moreover modularity is obtained through functions
BinaryByter
Like
BinaryByter
Not technically
BinaryByter
But...
Mat
Technically, there is none
There is. Function pointers are a thing, but i think he's not referring to them
A
Functions are implemented using pointers
Bt pointers r nt implemented using fnctions...
A
So there different
Anonymous
Bt pointers r nt implemented using fnctions...
Ur mean both r technical different
A
Ur mean both r technical different
Theoretically different too
Anonymous
BinaryByter
Bt pointers r nt implemented using fnctions...
Assembly wise, pointers and functions are the same
BinaryByter
You CALL a pointer, and you ACCESS a pointer
A
So?
Anonymous
Hi everyone
Talula
Assembly wise, pointers and functions are the same
Everything in Assembly is a pointer, even your instructions are what your CS (Code Segment) and IP (Instruction Pointer) points to, its a very pointy language.
Anonymous
Thanks for welcome 😊
BinaryByter
Well instructions are a bit less pointy, since an instruction isn't a pointer
BinaryByter
It is executed at the RIP
Vincenzo
In this case you need to pass "pointer to pointer"
//g++ 5.4.0 #include <iostream> void test (int **p = nullptr){ if (p){ * _p = & p; } } int *my_p; int main() { test(&my_p); test(); }
Rushikesh
Yep
Vincenzo
@ollirz i think that this way i am passing pointer to pointer correctly
Now whenever i change the value of _p also p would be affected, if i am not wrong
Anonymous
Thanks for your welcome for my thanks 😊
Punit
/* Thanks */
Gymcap
This is pretty cool
StefanHawk
Hi all! ^^
Anonymous
Heyho frens
Anonymous
Is there a way one can secure an Android phone for antitheft safety....imei isnt working
Anonymous
Thanks for welcome
Anonymous
Anybody have online compiler arm?
klimi
There are some on internet
BinaryByter
Anybody have online compiler arm?
A single google query would suffice
BinaryByter
But instead, you choose to ask
BinaryByter
Anonymous
Anonymous
no library
Mat
They all sucks
Do you need an online compiler while the ones on internet sucks?
Anonymous
Hmm... better no ask '~'
klimi
no library
That's .... Understandable
BinaryByter
no library
'i can't install software on other people' s computers :'(('
Anonymous
Anonymous
Can anyone explain this??
Mat
Can anyone explain this??
What's your problem?
Anonymous
What's your problem?
I just want to check my logic, if its correct or not...can you share how it is C?