Hi guys,
Thank you, both of you for your answers.
@iMalc: I actually did find this paper. But I guess I was just too intimidated by the size of it and hoped I would get a simpler answer...
Type: Posts; User: avi2886
Hi guys,
Thank you, both of you for your answers.
@iMalc: I actually did find this paper. But I guess I was just too intimidated by the size of it and hoped I would get a simpler answer...
Hi,
I ve a nagging question that I have been unable to figure out. From what I understand,
floats have a precision of 6 digits. And this is supposed to be 6 digits in total, not just 6 digits...
dwks.. U re awesome!!.. :)
It works now.. Thanks a ton. I was quite lost back there..
So am I right in understanding that, with qsort, u should cast the variables inside the compare function into...
Hi,
I am trying to q-sort an 2D array containing 2 columns of floats. The array must be sorted on the basis of any one of the columns.
This is the code that I wrote..
int compare(...
I haven't worked with the fpos_t datatype before. Does it store the position in bytes? I mean if I wanted to move to a certain bytes away from the current position, how should I increment the...
Thanks for the quick reply brewbuck. I am doing my developing on Windows using VC++. Do you happen to know how to get fseeko64() in VC++ environment..? Or do u know of any alternatives that I can use...
Hi all,
Sorry to be reporting to an old thread. But I just realised that the problem that I announced as having been fixed above was actually not properly fixed. The issue was that I was...
I fixed the integer overflow and it works fine now.! Thanks for the help guys..
Posting my code here incase anyone is interested..
int max_fseekrow;
int start_row=18375, n_cols =2960,...
Oh.. never thought about that. So the problem is that fseek defines its offset to be a signed integer. And my number is an invalid signed integer.. Makes sense.
I guess I ll ve to use a...
Hi all,
I have a file consisting of a huge array of floats written in binary mode (fwrite). Its actually a contiguous 2D array. I need to access various parts of the array and for this I...
Unless your file runs to tens of GB, you shouldn't have a problem opening it at once. Atleast as far as I know..
Open the file and fgets in a loop to get one line after another..
Standard C...
Yes.. Got it now. Thanks for the explanation. Cheers..
Oh.. Tat works!. Thanks a ton for the help.. Not being able to figure that out was driving me nuts.
So.. the problem was that when I just return the difference between 2 numbers, sometimes the...
@Matsp: Sorry bout that.. My bad. But fixing that typecast to
int a1 = (int) (* (float *) a) doesn't mean to make much difference. I still get the same output. Btw, if I assign a float to an...
Hi,
I am trying to qsort an array of floats and for some reason I am not getting the proper results. I am posting my code here. Could any of you take a look and tell me what I am missing.
...
Ok.. So basically what you are saying is that the open mode doesn't really matter and what does is actually whether I use fprintf() or fwrite() to write it into the file.. That makes sense.. cos we...
Thanks for the replies guys.. One point I forgot to mention was that the file is created using another program which I wrote. After seeing your replies I went back to that program and changed it to...
Hi all,
I have a file in which each line is a tab seperated array of floats. And i have close 200,000 lines in that file. Now, I wanted a fast way to read this file.. Reading it line by...
Hi all,
As a part of my program, I am opening a file and reading it line by line in a loop and processing the lines.
But my program keep crashing when I try to run it..
...
You were right.. I had written *array[i] instead of (*array)[i] while filling the array. That was what was causing the program to crash. Apologies..
I understand what you were trying to tell...
Thank u, both of u for ur replies..
@Laserlight : I tried to compile the exact code that u posted (filling in the array filling step ofcourse) and run it. But it still crashes.. I guess even...
Hi laserlight,
Thanks for the reply. I understood what you said about using a seperate variable to keep track of the size of memory being allocated. But how should I use that...
Hi all,
I have a question about passing pointers to functions. Here's what I am doing.. I am defining a pointer to an array in my main and passing this pointer to a function.
Inside this...
Hey,
Thanks a lot for the quick replies guys. It makes sense now.. Both the methods work. 'using only fgets and sscanf on what I need to parse' and also 'Just adding a space at the end of...
Btw.. just in case its relevant, I am doing this on the Microsoft Visual C++ 2005 cl compiler. And for now, I got around it by reading the prev line with fgets and doing sscanf on it. But i would...