J
Juggernaut
Im working on an assignment in c (which im not very familiar with at all,
since I prefer java).
And im loosing my hair on this because I've already gotten stuck at the very
beginning, at the simplest thing (atleast it is in java), which is creating
a 2 dimensional array and filling it.
I get this error message when I try to compile it: with gcc" warning:
assignment makes integer from pointer without a cast".
Now I can't continue with my assignment (wich is huge) until I can come past
this (what I would think for anyone else would be a small problem) problem.
I've been reading about pointers and arrays now for the last hour and I just
don't get what Im doing wrong.
Can anyone help me on this so I can move on?
Here's the code:
#include <stdio.h>
#include <stdlib.h>
#define NUM_THREADS 5
#define SIZE 10
int main(int argc, char *argv[])
{
char array[SIZE] [SIZE];
int i, j;
for( i=0; i<IS_SIZE; i++){
for( j=0; j<IS_SIZE; j++){
array[j] = "B";
printf("%d", array[j]);
}
printf("\n");
}
}
since I prefer java).
And im loosing my hair on this because I've already gotten stuck at the very
beginning, at the simplest thing (atleast it is in java), which is creating
a 2 dimensional array and filling it.
I get this error message when I try to compile it: with gcc" warning:
assignment makes integer from pointer without a cast".
Now I can't continue with my assignment (wich is huge) until I can come past
this (what I would think for anyone else would be a small problem) problem.
I've been reading about pointers and arrays now for the last hour and I just
don't get what Im doing wrong.
Can anyone help me on this so I can move on?
Here's the code:
#include <stdio.h>
#include <stdlib.h>
#define NUM_THREADS 5
#define SIZE 10
int main(int argc, char *argv[])
{
char array[SIZE] [SIZE];
int i, j;
for( i=0; i<IS_SIZE; i++){
for( j=0; j<IS_SIZE; j++){
array[j] = "B";
printf("%d", array[j]);
}
printf("\n");
}
}