I_Interface
m1 is a object Matrix that contains a matrix3D
Then use methods to operate with matrix inside object. What's the problem?
I_Interface
But I don't know how to select the elements of the matrix contained in the objects
I think you get this code from somewhere and don't know how to work with that.
gallo
Then use methods to operate with matrix inside object. What's the problem?
I don't know how to do, If I had known I would not have asked
I_Interface
I don't know how to do, If I had known I would not have asked
Then write methods to work with matrix elements !
I_Interface
I don't know how to do, If I had known I would not have asked
Are u banned from google ? Can't google it step by step ?
gallo
This is the problem, I don't know how to select these elements
Mar!o
gallo
Are u banned from google ? Can't google it step by step ?
I searched but there were other examples not explained
I_Interface
This is the problem, I don't know how to select these elements
Read about arrays before and operations with them.
gallo
This is the problem, I don't know how to select these elements
To select the matrix contained in this object, not the operations with array
Mar!o
I_Interface
To select the matrix contained in this object, not the operations with array
U don't know how to work with arrays. If you don't know, u can't work with matrices.
gallo
U don't know how to work with arrays. If you don't know, u can't work with matrices.
Yes I know, I don't know how to work with the elements of classes
gallo
It's different I know how to do this sum, but i can't "takes" the matrices contained in the objects
I_Interface
U don't know it.
I_Interface
Okay(?)
Especially how to work with class members.
I_Interface
Thanks for the help(?)
That's need for you, if u want to be a programmer.
Mar!o
Still I dont know why they have to dynamic allocate everything
gallo
That's need for you, if u want to be a programmer.
I have already read a lot of times, I know the theory more or less and now I was trying to do this exercise to put it into practice, I encountered this difficulty, I looked for people with similar problems or explanations from various parts but I did not find nothing. Rereading the slides again with the explanations of class theory I don't see how it should help me
Mar!o
I´ve seen horrible things in my life: auto add_floats(float a, float b) -> float { return a + b; } auto main(void) -> signed { float* a = new float(3.14f); float* b = new float(2.44f); float* c = new float(); *c = add_floats(*a, *b); delete a, delete b; print("%f", *c); delete c; } I dont know who wrote this but I would call him the Dynalloc Psycho!
Anonymous
I T 'S A N E X E R C I S E
The beep test is an exercise designed to measure aerobic fitness
Anonymous
gallo
Is this your help? Okay
Mar!o
Come on guys - stop beeing so toxic
Javi
no one knows?
Is it an error or a warning?
Maksim
Is it an error or a warning?
error: error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. note: см. объявление "scanf"
Javi
It says it pretty clear. Your compiler doesn't like scanf
Maksim
Missed a returned value
Sasuke
Hey guys I already know C language and now I want to extend my knowledge to C++ so which book is best to start learning C++ best in the sense which gives reference and comparision with C and not covering same topic in depth again like pointers, arrays etc..
Dima
psst
Anonymous
Missed a returned value
Lol why you don't use monospace font
Ash
void fun(int arr[]) { int i; int arr_size = sizeof(arr)/sizeof(arr[0]); printf("%d\n",sizeof(arr)); printf("%d\n",sizeof(arr[0])); for (i = 0; i < arr_size; i++) printf("%d ", arr[i]); } int main() { int i; int arr[4] = {10, 20 ,30, 40}; fun(arr); return 0; }
Ash
OUTPUT produces 8 4 and 10 20
Ash
can someone explain me how 8 is the size of the array
Anonymous
Wtf
Anonymous
Don't use sizeof/sizeof
Anonymous
It doesn't work
Anonymous
Use a variable to pass the size
Sasuke
OUTPUT produces 8 4 and 10 20
why are you trying to calculate the size of array when you already know? pass an extra argument in the function for array size
Ash
Well as off now i know.. That pointer to the array Iss passed in the functions...
Anonymous
The size of variables depends on the system and the compiler you are using
Ash
So I was hoping that the pointer size will be 4 so 4/4 =1
Anonymous
OUTPUT produces 8 4 and 10 20
https://stackoverflow.com/questions/2331751/does-the-size-of-an-int-depend-on-the-compiler-and-or-processor
Dima
Ash
ohh damm i realize it just know
Ash
i got this
Anonymous
Ash
i was overlooking the fact that the pointer has a fixed addtress
Ash
that does not depend on the type
Ash
it is location of course
Sasuke
So I was hoping that the pointer size will be 4 so 4/4 =1
each int has 4bytes of space in most system so if thats the case sizeof(arr) will return 4*4 = 16 bytes
Ash
thank u guys ... KULDIP, SUNIL DANYA
Dima
thank u guys ... KULDIP, SUNIL DANYA
Lol Danya is nice Indian name
Ash
i appreciate ur quick responses
Anonymous
Being an Indian, I too have seen this name for the first time... But pretty name
Sasuke
#cppbookguide
No man read my full question
Anonymous
No man read my full question
No man read the article
Anonymous
For data structure and algorithms, I have been using this book... pretty well explained.. Take a look Data Structures and Algorithms - Narasimha Karumanchi
Sasuke
No man read the article
Man I did already
Sasuke
Hey guys I already know C language and now I want to extend my knowledge to C++ so which book is best to start learning C++ best in the sense which gives reference and comparision with C and not covering same topic in depth again like pointers, arrays etc..
Anonymous
@Kuldip You should go for the book I mentioned