klimi
But I would prefer going Google way
klimi
C book will take ages
Sagar
Ok..is anyone here who knows c?
Sagar
But I would prefer going Google way
Already gone through this.
klimi
You should be able to do it them
Mat
What's the question?
klimi
klimi
But we're stuck on input
Mat
Do you know how to calculate a determinant?
Sagar
Theoretically?
klimi
Yep
Sagar
On paper and pen?
klimi
Yes
Sagar
Yes I do
klimi
So you're able to program it
Mat
Yeah, the algorithm behind it
Sagar
I knw all the theoretical parts just dnt knw the language part
Mat
So you know how to elaborate data
klimi
So first part of the solution would be getting input from the user
Mat
You have to get input from the user
@Sagarmodak1997 Is that the problem?
Sagar
Yes
Mat
You can do a double for loop which takes every number from the user: Insert element[0][0]: 3 Insert element[0][1]: 5 Insert element[0][2]: 1 ...
klimi
User will input how big data will be
Mat
He doesn't know how to do it dynamicaly
Insert number of rows: 4 Insert number of columns: 7
Mat
After that input, they'll have fixed number of elements
Sagar
So you are basically saying that I should use scanf with arrays?
Sagar
Hm..but how will I do that? I mean they are two separate things
Sagar
Aren't they?
klimi
Array
klimi
Is just a group of something
klimi
Eg of int or double
Sagar
Is just a group of something
I knw tht but I dnt know how to use it with scanf
Mat
Pseudocode will be something like Insert rows and columns Create array w/ given input for every row i for every column j insert array[i][j]
Sagar
*now
Sagar
Thanks..thanks a lot
Sagar
It was a grt hlp
Mat
If you want to create a better input method, learn how to read files :)
Mat
Then you'll only need to modify the file in order to analyze the matrix
Sagar
I knw tht a little bit
Mat
You mean file opeartion?
Yeah. The user will modify the file with his matrix and the application will directly do operations
Mat
👍
klimi
I don't but I don't have to xD
Mat
I don't but I don't have to xD
😂😂😂 No problem ahaha
Anonymous
struct a{char ** b;} how to printf b ?
Mat
struct a{char ** b;} how to printf b ?
You need to create a struct, then access it
Daniele°
struct a{char ** b;} how to printf b ?
Need size struct a{char** b; size_t line}; ... struct a z; ... for(size_t i =0; i<z.line;++i) printf("[%lu]%s\n",i,z.b[i]);
Daniele°
Daniele°
You can set to NULL last line
Daniele°
struct a{char** b;}; ... struct a z; ... for(size_t i =0; z.b[i];++i) printf("[%lu]%s\n",i,z.b[i]);
Daniele°
Need size struct a{char** b; size_t line}; ... struct a z; ... for(size_t i =0; i<z.line;++i) printf("[%lu]%s\n",i,z.b[i]);
init with: z.b=malloc(sizeof(char*)*10); z.line=10; for(size_t i = 0; i<z.line;++i){ z.b[i]=malloc(sizeof(char)*32); strcpy(z.b[i],"hello"); }
BinaryByter
you need the size of chars
BinaryByter
unless you nede an array of char pointers
BinaryByter
which you don't
Daniele°
BinaryByter
z.b[i]=malloc(sizeof(char)*32); strcpy(z.b[i],"hello");
BinaryByter
oh whoops you need an array of pointers
BinaryByter
what is your problem?
Daniele°
char** is a pointer to pointer char
Daniele°
i know i know
Begin allocate a space for containing line: char** b = malloc(sizeof(char*)*NumberOfLine);
Daniele°
Next allocate space for every line
Daniele°
z.b[i]=malloc(sizeof(char)*32); strcpy(z.b[i],"hello");