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();
}
@unchanted
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
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?
piggyho
Artöm
An allocator can do 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
Anmol
Arthur
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
Anmol
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
Anmol
Arthur
first of all - store pointers in a ponter type like
int *pointer = &address;
PO
PO
Arthur
PO
I don't know, it's gcc compiler on Ubuntu
Arthur
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
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?
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
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
PO
But It doesn't help to resolve my problem