I'm having a weird scoping issue where I add a new instantiation of a class (edge) to a Vector (edges). However, no matter how many layers of newness I add to the edge that I add, it creates a pointer to the same object...so I get a Vector with a bunch of copies of the last object that I add...
Yes, but shouldn't the division take care of that? I mean, shouldn't I be able to reutnr things like 16855/155683 = some long float string? Those are both integers...
Hi, I'm trying to generate some random floats, preferablly with a fairly involved post decimal presence, if you take my meaning. Currently, I've tried this...#include <stdlib.h>
#include <time.h>
int main()
{
float check;
int i;
srand((unsigned )time( NULL ));
for (i = 0; i < 20...
yeah, so can someone give me a more down to earth explanation of diff? I'm trying to compare 2 files of aournd 5000+ lines lenght, which should (I hope) be similar if not identical. I do not understand diff, however, and man pages are...poorly written.
Thanks!
Given the direction microsoft is taking (not that I've ever liked microsoft, understand, but I was willing to put up with them.) that does seem something of a sin. The only problem being, no one has yet managed to build a decent game specifically for linux. If I could get Half-life DoD ported...
I tried man strtod, strtof, and niether worked. the only strto function I could get a man page for was strtol, which obviously returns long integers, so no help. I'll try using strtod and casting to float. (need an exact length). Thanks alot!
I'd still like to know why it compiles for...
phoenix:~/sean % gcc -g functions.c
/var/tmp/ccuTj3uV.o: In function `string2float':
/home1/sabbott/sean/functions.c:104: undefined reference
to `strtof'
hmmm...any idea why my...
Just a note, I've corrected the function instantiation to "float string2float(char * word)"
but this obviously hasn't helped with the compile error.
You can also use tolower(int c) to lower things.
(Yes, I know this was a pointless post, but I've been asking so many question I felt like I needed to answer one, even if its one that didn't exist.)
For some reason, this
#include <stdlib.h>
int string2float(char *word)
{
float ret;
ret = 0;
ret = strtof(word, NULL);
return ret;
}
gives me an "unidentified reference to strtof" at the line of ret = strtof(word, NULL);
Which really confuses me, because elsewhere in this...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.