Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- typedef struct node {
- int col;
- float val;
- struct node* next;
- }node_t;
- typedef struct {
- int NR;
- int NC;
- node_t** rows;
- }matr_t;
- void MATRwrite(matr_t* M, int r, int c, float val) {
- node_t* newNode;
- // out newNode ./int col = ??, float val=??; ......next;
- newNode = malloc(sizeof(node_t));
- // out newNode ./int col = 1232323121, float val=224232.00000; ......next;
- newNode->col = c;
- newNode->val = val;
- newNode->next = M->rows[r];
- M->rows[r] = newNode;
- }
Advertisement
Add Comment
Please, Sign In to add comment