olli
struct Foo { void Bar(); void Qux(); }; void Foo::Bar() { // this is the object Bar is // called on, can be used to // access other non-static // member or call non-static // functions this->Qux(); (*this).Qux(); } void Foo::Qux() {} int main() { // no this here, main is never // called on an object Foo F{}; // PF points to a Foo object, // can use -> to call member // functions Foo *PF = &F; PF->Bar(); // Derefercing and using . // works as well (*PF).Bar(); }
Henry
Hi I need one who would teach me itineration operation
Henry
I couldn't understand it from the book
Alex
hi. what don`t you understand exactly?
Henry
Henry
Like when writing a pyramid pascal triangle
Artöm
A loop executes statements in body while condition holds
Peejay
Good day guys. Am glad to be here. It my first time
Anonymous
Hello! Let's say there are 2 functions func1, func2 defined inside a class1. Now while defining func1outside the class, i have to use func2, now should i directly parse func2 or class1.func2 ??
if you want to return func2 then you have to use class1::func2 in the return type, otherwise once you are in the scope of the class through class1::func1(, you can just use any member of the class without requiring an explicit mention of the this pointer.
Anonymous
class1::member class1::func(member a, int b) { // ^ required here and nowhere else member c = d; }
@unchanted
Is it possible to create a linked list without using pointer concept? I mean "what if i wish to give an address to the next node as an input?" What could be an approach to this situation
Artöm
Why not just use pointers?
@unchanted
Why not just use pointers?
If user wish to give address in case he/she wishes to trace where the data is stored
Artöm
An allocator can do it
@unchanted
An allocator can do it
Can you elaborate allocator I can't get it
Artöm
Read about what Allocator does and go through std::allocator interface
@unchanted
Ok
@unchanted
Thanks
PO
who can explain to me what does it mean Segmentation Fault (Core dumped)?
Anmol
PO
https://en.wikipedia.org/wiki/Segmentation_fault
Thank you but I don't how should I fix it
Arthur
who can explain to me what does it mean Segmentation Fault (Core dumped)?
looks like you trying to access to memory cell that you shouldnt
PO
I get error when execution of the file come to here
PO
nsigned int i, j; unsigned int range = 115; unsigned int target = &matrix[i][j]; printf("\n \n * * * * * * * Black & White * * * * * * * \n \n"); for (i = raw - 1; i >= 0; i--) { for (j = column - 1; j >= 0; j--){ if(target< range){ matrix[i][j] = 0; }else{ matrix[i][j] = 255; } } }
Anmol
This should be enough of a hint
PO
This should be enough of a hint
I want compare the element inside of the array with 115
Anmol
I want compare the element inside of the array with 115
If you still don't understand what's wrong here, you should consider learning the basics
Anmol
I think I have to change targe from simple vriable to an array
Here's another hint. "uninitialised variables"
Arthur
Yes, you are trying to get the address of two dimensional array (its hex) and put it into unsigned int (0-255 range int only) for what?
PO
yep
Mar!o
This should be enough of a hint
you cannot store a pointer (&) in an unsigned int - it's not safe
PO
Yes, you are trying to get the address of two dimensional array (its hex) and put it into unsigned int (0-255 range int only) for what?
because I have to compare, each element of array with 115. if the element is less than 115 I should replace it with 0 and higher I have to replace with 255
Arthur
first of all - store pointers in a ponter type like int *pointer = &address;
Arthur
nothing change
have you any description of your task?
PO
I don't know, it's gcc compiler on Ubuntu
Anunay
cs50 is a harvard course lol
Anunay
https://cs50.harvard.edu/summer/2020/
Arthur
https://cs50.harvard.edu/x/2020/psets/4/filter/less/
Arthur
check that link, its about your task - blur, grayscale, reflection, and sepia on bitmap images
PO
Arthur
every time if something doesnt compile scroll up and check the first lines of errors
PO
ok
PO
I get it why
PO
I have copied and pasted my previous loop and I had forgotten to change the vlaue
Anonymous
I want to object move automatic in c
Anonymous
How to write code
Anonymous
Need small projects in c coding suggestion
Anonymous
Lol wat
Anonymous
I need to code for move object automatic like snake game
PO
How do you compare an element of an 2d array with a number?
PO
guys
PO
Anonymous
I'm currently learning c++
Anonymous
How do you guys survive 😰😰
Anonymous
are you a college/uni student?
PO
are you a college/uni student?
yes, first year of university
Anonymous
please get a CLion subscription (it's free for students). you'll learn to use tools
Anonymous
and get some help writing better C
PO
are you a college/uni student?
do you understand why it get me 18 18 18 40 28 24 73 61 54
klimi
How do you guys survive 😰😰
you mean sleep deprivation, depression, loneliness and lack of motivation?
Anonymous
do you understand why it get me 18 18 18 40 28 24 73 61 54
no clue. your code just looked ugly, so i suggested using CLion
Anonymous
sometimes just following the basic clangd suggestions fixes stuff
klimi
ye clang is actually pretty nice in this
Anonymous
Anonymous
what is that?
https://www.jetbrains.com/clion/ don't get attached to the ide. learn the tools it integrates with (clangd, clang-tidy, CMake, editorconfig/clang-format, etc etc)
Anonymous
then integrate them to your Atom (or VSCode) workflow
PO
But It doesn't help to resolve my problem
Anonymous
But It doesn't help to resolve my problem
maybe it will. maybe you are doing some basic mistake like uninitialised variable above.