CommonTater that is not the point...i know that...
i will be honest...i still dont get it...why my loop doesnot work...
laserlight if you have a minute i would really be thankfull if you could...
Type: Posts; User: notcodemonkey
CommonTater that is not the point...i know that...
i will be honest...i still dont get it...why my loop doesnot work...
laserlight if you have a minute i would really be thankfull if you could...
thanks laserlight...
with your piece of code it works...and compiler is quiet...
thanks...
this is the same code and loops but without dynamic allocation and all works fine...
sorry all for your time... but i really dont know where is mistake... and i KNOW that it is not in loop because...
code and loops works fine...look this code without dynamic allocation...
#include<stdio.h>
#include<stdlib.h>
int main() {
int *polje=NULL,N,v,b,i;
int k[1000]={0};
i still dont get what should i do... i tried -1,+1,stay the same...
whatever i put is still put message stop working...
the loop is about the sieve of Eratosthenes...i dont know if you heard about that,its method which separates prime numbers from all other numbers...
this loop is okay because this code works fine...
v is important in this loop so i think that i should not move this...
CommonTater i try using that too..
but its still not working to the end...
its just one difference ...i saw that calloc inicialize all elements to 0 so i put that...and what you said about loop to N-1..i put it and its still problem...
#include<stdio.h>...
i think i understand what zou are saying...
but if i put
...
for(b=2;b<=N-1;b++) {
...
for (i=2;v<=N-1;i++) {
i dont get it... please explain...
i erased one line
free(p);
and now there is no message...and all works fine and he prints the last line...
why...we should always use free after dynamic memory allocation...is not that right......
this code is about prime numbers ... and compile print prime numbers but then shows message stop working.. i used dynamic memory allocation but cant find where is problem... thanks in advance...
...