I can't believe I did such a stupied mistake.
Thank you guys!
Type: Posts; User: salvadoravi
I can't believe I did such a stupied mistake.
Thank you guys!
Thank you hk_mp5kpdw.
Howerver I still can't understand what I did wrong...
This code runs without problems on VS6, but crashes on VS2005 (I've just started to use VS2005)
Please WHY??
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct
Hi guys,
I just can understand recursions!
This is really putting me down.
I've started quite good, and I perfectly understand the following example:
void MyRecursion ( int n )
{
I will adapt mat's suggestion too if the file is sorted. (thank you)
and Todd's if not (thank you too)
I still don't understand how can I resize a file size on Windows....
Cheers!
How do I resize a file?
Hi ALL,
Lets say I have a file name "cars.bin".
Each record in the file is a struct (made from int, char [20], int).
Lets say I have 10000 records,
struct 1, struct 2, struct 3, struct .....,...
Sorry for the stupied question, it makes alot of sense and I should figure it out from Prelude reply . (too much computer for one day....)
Thanks again
Guys when I use the following loop
for (i=0;i<20;++i)
{
srand(time(NULL));
printf("%d\n",rand()%((10)+1));
}
Hi again,
I know that if I want to get different random values I should use srand() before using rand(), my questions are:
1) Why using srand() inside a loop will produce the same results?
...
Got IT now!!!
Thank you pros
Thanks for your replies guys,
I will rephrase the question.
Why buf[0] not set to NULL when fgets read the end of the file?
Thanks again
Hi guys,
I've just read the FAQ about NOT to use feof(fp) to check if we reached the end of the file.
It all make sense but I don't understand 1 thing...
while (!feof(fp))
{
...
Thank you!!
Hi Guys,
After getting some brilliant replies about fflush(stdout), I would like to get some details about flushing a file.
When Should I fflush a file when writing stream to a file when I use...
Got it,
This is my stdio.h macro for BUFSIZ
#if defined(_M_MPPC)
#define BUFSIZ 4096
#else /* defined (_M_MPPC) */
#define BUFSIZ 512
#endif /* defined (_M_MPPC) */
Sorry guys what is BUFSIZ?
Brilliant, thank you!
Yep.
I've created a 3000,000 kb.
ftell() gave the right result until MAX_LONG after that it return -1.
I actully created 9.5 GB file.
Anyone know what is the limit in windows XP?
Many...
Thank you great stuff!
Cheers!!
Thanks a million
Hello again,
If ftell() return long type, is that mean that the maximum file size possible is LONG_MAX ??
Hiiiii guys,
What is the difference between stdio.h and cstdio.h ??
Thank you!
Do I need to use:
fflush(stdout);
Each time I print something to the screen (printf, puts, putchar.....) ?
If So why?
Many thanks !!!