compilation - Compile error using sqrt() in c -


i have problem using sqrt() in c.

i'm trying this:

int a;  = sqrt(9); 

etc

i'm restricted use:

gcc -ansi -wall -pedantic onefile.c anotherfile.c thirdfile.c -o outputfilename 

how can make compile without using -lm command?

yes, have #include !

is there way around , still use sqrt()?

thanks

just try function, if don`t want use library.

sq_root(n) {     count=0;     int = 0;     for(i=1;sum<=n;i+=2)     {         sum+=i;         count++;     }     return (count); } 

this work, without math library.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -