473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

fscanf hangs

I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).

I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.

ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;

if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
if (iRead==0 || iRead==EOF) break;
} while (lX < lLastX || lY < lLastY);
}

I am wondering if I should just do binary reading so as to have more
control over what is going on.

Many thanks in advance for any assistance,
Peter.

Jun 18 '07 #1
37 4897
On Jun 18, 10:19 am, PeterOut <MajorSetb...@excite.comwrote:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).

I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.

ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;

if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
if (iRead==0 || iRead==EOF) break;
} while (lX < lLastX || lY < lLastY);

}

I am wondering if I should just do binary reading so as to have more
control over what is going on.

Many thanks in advance for any assistance,
Peter.
Dear Peter,

Your are not closing the file.
Use fclose for closing the file.

Thanks and regards,
Amal P.

Jun 18 '07 #2
On Jun 17, 9:32 pm, Amal P <enjoyam...@gmail.comwrote:
On Jun 18, 10:19 am, PeterOut <MajorSetb...@excite.comwrote:


I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.
ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;
if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);
do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
if (iRead==0 || iRead==EOF) break;
} while (lX < lLastX || lY < lLastY);
}
I am wondering if I should just do binary reading so as to have more
control over what is going on.
Many thanks in advance for any assistance,
Peter.

Dear Peter,

Your are not closing the file.
Use fclose for closing the file.

Thanks and regards,
Amal P.- Hide quoted text -

- Show quoted text -
Sorry. I am closing the file with
fclose(fpInFile);
but forgot to include that in the sample code that I posted. The
problem, unfotruntately, lies elsewhere.

Thanks,
Peter.

Jun 18 '07 #3

"PeterOut" <Ma**********@excite.comwrote in message
news:11**********************@c77g2000hse.googlegr oups.com...
>I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).

I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.

ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;

if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
%d is for type 'int'. For type 'long', use %ld.

Also make sure you've #included <stdio.hfor the
declaration of 'fscanf()'.

-Mike

Jun 18 '07 #4
On Sun, 17 Jun 2007 18:19:37 -0700, PeterOut <Ma**********@excite.com>
wrote:
>I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
You posted to numerous inconsistent newsgroups. Are you coding in C
or C++? What do you think this has to do with Microsoft Foundation
Classes?
>
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.

ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;

if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

do
{
// It randomly hangs on the followinf
line
How do you determine that?
> iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
if (iRead==0 || iRead==EOF) break;
You really should check that fscanf did everything you asked and iRead
is in fact 5. If 0<=iRead<5, there is something wrong with the data
in your file.
> } while (lX < lLastX || lY < lLastY);
}

I am wondering if I should just do binary reading so as to have more
control over what is going on.

Remove del for email
Jun 18 '07 #5
PeterOut wrote:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).

I am not sure if this is a C, C++ or MS issue
from the variable names, it looks like a Transylvanian Heresy problem,
but...
but fscanf has been
randomly hanging on me.
Because you use the wrong specifiers to fscanf

[...]
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
[...]
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
"%d" is the specifier for an int, but lLong1, lLong2, and lNum are not
ints. If you are going to clutter your code with those god-awful names
that carry their types with them, I would think you would learn basic
stuff like this.
Jun 18 '07 #6
On Jun 18, 3:19 am, PeterOut <MajorSetb...@excite.comwrote:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.
The code would be a lot easier to understand (and a lot safer)
if you'd use ifstream instead of fscanf. However...
ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;
if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
As others have pointed out, you need %ld to be correct. If this
doesn't cause problems immediately, it's because by pure chance,
longs and ints have the same size on your implementation.
if (iRead==0 || iRead==EOF) break;
And what is fscanf supposed to return in the case of:
"1 2 3x 4.5 6"
?

Personally, I'd probably impose that each data set be on a
separate line, and do something like:

std::string line ;
int lineNo = 0 ;
while ( std::getline( input, line ) ) {
++ lineNo ;
std::istringstream s( line ) ;
s >long1 >long2 >float1 >float2 >num >std::ws ;
if ( ! s || s.get() != EOF ) {
std::cerr << "Syntax error in line "
<< lineNo
<< ", ignoring it"
<< std::endl ;
} else {
// ...
}
}
>From your code, it's also not too clear where the lX and lY come
from, or how they evolve to handle your end conditions.
Normally, written correctly, using std::vector, you should be
able to automatically scale any arrays to the amount of data
read.
} while (lX < lLastX || lY < lLastY);
}
I am wondering if I should just do binary reading so as to have more
control over what is going on.
How would that change anything?

--
James Kanze (GABI Software, from CAI) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jun 18 '07 #7
Martin Ambuhl wrote:
>
.... snip ...
>
"%d" is the specifier for an int, but lLong1, lLong2, and lNum
are not ints. If you are going to clutter your code with those
god-awful names that carry their types with them, I would think
you would learn basic stuff like this.
That seems like fairly accurate straight forward advice :-)

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 19 '07 #8
On Jun 17, 10:06 pm, "Mike Wahler" <mkwah...@mkwahler.netwrote:
"PeterOut" <MajorSetb...@excite.comwrote in message

news:11**********************@c77g2000hse.googlegr oups.com...


I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.
ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;
if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);
do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);

%d is for type 'int'. For type 'long', use %ld.

Also make sure you've #included <stdio.hfor the
declaration of 'fscanf()'.

-Mike- Hide quoted text -

- Show quoted text -
Thanks very much for your help.
I had #included <stdio.hbut changed the %d to $ld and have not had a
problem since. I was surprised that it made a difference on 32-bit
Windows since I thought int and long were both 32 bits on 32-bit
Windows. I think they are different on Unix and Linux where I think
it is 32 bits for int and 64 bits for long but I may be wrong.
Thanks again,
Peter.

Jun 19 '07 #9
On Jun 18, 12:58 am, Martin Ambuhl <mamb...@earthlink.netwrote:
PeterOut wrote:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue

from the variable names, it looks like a Transylvanian Heresy problem,
The original variable names were application specific althought they
included the Hungarian notation that everyone seems to like so much ;)
but...
but fscanf has been
randomly hanging on me.

Because you use the wrong specifiers to fscanf

[...]
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
[...]
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);

"%d" is the specifier for an int, but lLong1, lLong2, and lNum are not
ints. If you are going to clutter your code with those god-awful names
that carry their types with them, I would think you would learn basic
stuff like this.
Mike had pointed that out and I have not had any problems since I
fixed it. However, it had been runing w/o problems beforehand and
then started playing up and hagning there for some reason.

Thanks,
Peter.

Jun 19 '07 #10
On Jun 18, 4:36 am, James Kanze <james.ka...@gmail.comwrote:
On Jun 18, 3:19 am, PeterOut <MajorSetb...@excite.comwrote:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.

The code would be a lot easier to understand (and a lot safer)
if you'd use ifstream instead of fscanf. However...
Thanks. The code appears to be woking OK now that I have fixed the %d/
%ld problem but will certainly look into that if fscanf gives me any
more problems.
>
ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;
if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);
do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);

As others have pointed out, you need %ld to be correct. If this
doesn't cause problems immediately, it's because by pure chance,
longs and ints have the same size on your implementation.
if (iRead==0 || iRead==EOF) break;

And what is fscanf supposed to return in the case of:
"1 2 3x 4.5 6"
?

Personally, I'd probably impose that each data set be on a
separate line, and do something like:

std::string line ;
int lineNo = 0 ;
while ( std::getline( input, line ) ) {
++ lineNo ;
std::istringstream s( line ) ;
s >long1 >long2 >float1 >float2 >num >std::ws ;
if ( ! s || s.get() != EOF ) {
std::cerr << "Syntax error in line "
<< lineNo
<< ", ignoring it"
<< std::endl ;
} else {
// ...
}
}
Yes. Being able to split things up would probably make it easier to
diagnose the problem.
>
From your code, it's also not too clear where the lX and lY come

from, or how they evolve to handle your end conditions.
Normally, written correctly, using std::vector, you should be
able to automatically scale any arrays to the amount of data
read.
} while (lX < lLastX || lY < lLastY);
}
I am wondering if I should just do binary reading so as to have more
control over what is going on.

How would that change anything?
I thought that it might make the problems more transparent. fscanf
did not return an error. It just hung ad infinitum. Something
binary, I could just read the bytes and it would not really matter
about formatting. I could read everythings in as a character string
and then analyze it rather than relying upon however fscanf, or
whatever, was written.

Thanks again for your help,
Peter.
Jun 19 '07 #11
PeterOut wrote:
On Jun 18, 12:58 am, Martin Ambuhl <mamb...@earthlink.netwrote:
>PeterOut wrote:
>>I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue
from the variable names, it looks like a Transylvanian Heresy problem,

The original variable names were application specific althought they
included the Hungarian notation that everyone seems to like so much ;)
Not me
Jun 21 '07 #12
"Johan Bengtsson" writes:
PeterOut wrote:
>On Jun 18, 12:58 am, Martin Ambuhl <mamb...@earthlink.netwrote:
>>PeterOut wrote:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue
from the variable names, it looks like a Transylvanian Heresy problem,

The original variable names were application specific althought they
included the Hungarian notation that everyone seems to like so much ;)
Not me
You're supposed to read the smiley to indicate negation. Smileys are so
overused one needs a monograph on how to interpret them.
Jun 21 '07 #13
On Jun 17, 10:06 pm, "Mike Wahler" <mkwah...@mkwahler.netwrote:
"PeterOut" <MajorSetb...@excite.comwrote in message

news:11**********************@c77g2000hse.googlegr oups.com...


I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.
ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;
if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);
do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);

%d is for type 'int'. For type 'long', use %ld.

Also make sure you've #included <stdio.hfor the
declaration of 'fscanf()'.

-Mike- Hide quoted text -

- Show quoted text -
Unfortunately, the problem has started happening again, even with %ld
and #include <stdio.h>. I wonder if it's a problem with MS Visual C+
+. It seems to be correlated with my "breaking" during operation
although it is not clear whther that is a cause or an effect.

Thanks,
Peter.

Jun 22 '07 #14
PeterOut <Ma**********@excite.comwrites:
On Jun 17, 10:06 pm, "Mike Wahler" <mkwah...@mkwahler.netwrote:
>"PeterOut" <MajorSetb...@excite.comwrote in message
[...]
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.
[offending code snipped]
>%d is for type 'int'. For type 'long', use %ld.

Also make sure you've #included <stdio.hfor the
declaration of 'fscanf()'.

Unfortunately, the problem has started happening again, even with %ld
and #include <stdio.h>. I wonder if it's a problem with MS Visual C+
+. It seems to be correlated with my "breaking" during operation
although it is not clear whther that is a cause or an effect.
If you'll post your current code, along with a detailed description of
how it's failing, we can probably help. We can't guess what your code
actually looks like now. In the meantime, read section 12 of the
comp.lang.c FAQ, <http://www.c-faq.com/>; it's entirely possible that
you'll find the solution there.

I've dropped comp.lang.c++ and comp.os.ms-windows.programmer.tools.misc
from the newsgroups line.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 22 '07 #15
On Fri, 22 Jun 2007 07:55:45 -0700, PeterOut
<Ma**********@excite.comwrote:
snip obsolete code
>Unfortunately, the problem has started happening again, even with %ld
and #include <stdio.h>. I wonder if it's a problem with MS Visual C+
+. It seems to be correlated with my "breaking" during operation
although it is not clear whther that is a cause or an effect.
If you don't post your current code, no one will be able to help you.
If you keep posting to irrelevant groups, no one will want to help
you.
Remove del for email
Jun 22 '07 #16
On Jun 22, 3:12 pm, Keith Thompson <k...@mib.orgwrote:
PeterOut <MajorSetb...@excite.comwrites:
On Jun 17, 10:06 pm, "Mike Wahler" <mkwah...@mkwahler.netwrote:
"PeterOut" <MajorSetb...@excite.comwrote in message
[...]
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.

[offending code snipped]
%d is for type 'int'. For type 'long', use %ld.
Also make sure you've #included <stdio.hfor the
declaration of 'fscanf()'.
Unfortunately, the problem has started happening again, even with %ld
and #include <stdio.h>. I wonder if it's a problem with MS Visual C+
+. It seems to be correlated with my "breaking" during operation
although it is not clear whther that is a cause or an effect.

If you'll post your current code, along with a detailed description of
how it's failing, we can probably help. We can't guess what your code
actually looks like now. In the meantime, read section 12 of the
comp.lang.c FAQ, <http://www.c-faq.com/>; it's entirely possible that
you'll find the solution there.
Sorry about that. Herewith is the updated code.

------------------------------------------------------------

if ((fpFile = fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

{
float fMean, fSD;
long lX, lY, lNumItems, lLastX = fppPlane->iColumns-1, lLastY =
fppPlane->iRows-1;
int iRead;

do
{
iRead=fscanf(fpFile, "%ld%ld%f%f%ld", &lX, &lY, &fMean, &fSD,
&lNumItems);
if (iRead==0 || iRead==EOF) break;
fppPlane->Data[lY][lX] = fMean;
} while (lX < lLastX || lY < lLastY);
}

fclose(fpFile);

------------------------------------------------------------

Usually there is no problem but sometimes it hangs on
iRead=fscanf(fpFile, "%ld%ld%f%f%ld", &lX, &lY, &fMean, &fSD,
&lNumItems);

When it does not, iRead==5.

Thanks,
Peter.

Jun 23 '07 #17
PeterOut <Ma**********@excite.comwrites:
On Jun 22, 3:12 pm, Keith Thompson <k...@mib.orgwrote:
[...]
>If you'll post your current code, along with a detailed description of
how it's failing, we can probably help. We can't guess what your code
actually looks like now. In the meantime, read section 12 of the
comp.lang.c FAQ, <http://www.c-faq.com/>; it's entirely possible that
you'll find the solution there.

Sorry about that. Herewith is the updated code.

------------------------------------------------------------

if ((fpFile = fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

{
float fMean, fSD;
long lX, lY, lNumItems, lLastX = fppPlane->iColumns-1, lLastY =
fppPlane->iRows-1;
int iRead;

do
{
iRead=fscanf(fpFile, "%ld%ld%f%f%ld", &lX, &lY, &fMean, &fSD,
&lNumItems);
if (iRead==0 || iRead==EOF) break;
fppPlane->Data[lY][lX] = fMean;
} while (lX < lLastX || lY < lLastY);
}

fclose(fpFile);

------------------------------------------------------------

Usually there is no problem but sometimes it hangs on
iRead=fscanf(fpFile, "%ld%ld%f%f%ld", &lX, &lY, &fMean, &fSD,
&lNumItems);

When it does not, iRead==5.
It's still hard to tell what's going on, because you haven't shown us
a complete program. I see no main function, and no declarations
for fpFile, csFileName, ErrorOpeningFile, etc.

You also haven't given us any clue about what information is in the
file you're attempting to read.

Remember that fscanf with any of the numeric formats, including "%ld"
and "%f", will skip over any leading whitespace before reading a
number; whitespace can include newline characters. Are you attempting
to read from a disk file? Could it be that you're expecting a certain
layout for each input line, and the actual input you're seeing doesn't
match your expectation? I wouldn't expect fscanf to "hang" unless
it's reading from an interactive device, but it's something to think
about.

Also, fscanf invokes undefined behavior if the input value overflows
the target type. For example, if you attempt to read the string
"1.0e1000000" with a "%f" format, *anything* could happen.

Take the code you just posted and modify it into *small* *complete*
program that exhibits the problem. Here's a suggestion; tweak to
taste:

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
FILE *fpFile;
const char *csFileName = "input.txt"; /* or whatever */

if ((fpFile = fopen(csFileName, "r")) == NULL) {
fprintf(stderr, "fopen failed for %s\n", csFileName);
exit(EXIT_FAILURE);
}

{
int iRead;
long input1, input2;
float input3, input4;
long input5;

while (1) {
iRead=fscanf(fpFile,
"%ld%ld%f%f%ld",
&input1, &input2, &input3, &input4, &input5);
printf("%d: %ld %ld %g %g %ld\n",
iRead, input1, input2, input3, input4, input5);
if (iRead < 5) {
break;
}
}
}
fclose(fpFile);
exit(EXIT_SUCCESS);
}

Note that this just reads input items; it doesn't know or care what
they mean or how they fit into your other data structures.

If you can reproduce the same problem with this program, or with
something similar, then post again -- and tell us exactly what the
input file looks like. (In fact, trim the input file itself down to
the minimum necessary to reproduce the problem.) If you can do this,
you're likely to figure out the problem for yourself before you get
around to posting.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 23 '07 #18
On Fri, 22 Jun 2007 19:09:42 -0700, PeterOut <Ma**********@excite.com>
wrote:
>Sorry about that. Herewith is the updated code.

------------------------------------------------------------

if ((fpFile = fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

{
float fMean, fSD;
long lX, lY, lNumItems, lLastX = fppPlane->iColumns-1, lLastY =
fppPlane->iRows-1;
int iRead;

do
{
iRead=fscanf(fpFile, "%ld%ld%f%f%ld", &lX, &lY, &fMean, &fSD,
&lNumItems);
if (iRead==0 || iRead==EOF) break;
What you want here is
if (iRead != 5){Some very thorough debugging output. Printout
iRead and all five objects that should have been updated. You can end
with a break if you like but give yourself a fighting chance to see
where the error is.}
> fppPlane->Data[lY][lX] = fMean;
At this point, you might want to include some output just so you can
see the program progress through the file.
> } while (lX < lLastX || lY < lLastY);
This implies it is possible for lX to exceed lLastX. If it exceeds
the limit by more than one you will have invoked undefined behavior in
the previous assignment statement. Ditto for lY. It also means you
stop processing after the first value is stored in the last row or
last column, probably not what you intended.
>}

fclose(fpFile);

------------------------------------------------------------

Usually there is no problem but sometimes it hangs on
iRead=fscanf(fpFile, "%ld%ld%f%f%ld", &lX, &lY, &fMean, &fSD,
&lNumItems);
How do you know this is where it hangs?
>
When it does not, iRead==5.

Remove del for email
Jun 23 '07 #19
PeterOut wrote:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).

I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.

ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;

if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);

do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
if (iRead==0 || iRead==EOF) break;
} while (lX < lLastX || lY < lLastY);
}

I am wondering if I should just do binary reading so as to have more
control over what is going on.

Many thanks in advance for any assistance,
Peter.
Hmmm, I was thinking that it might be a consequence of corrupt memory
(like buffer overruns, changing memory after free() (or equivalent) or
some other similar problem).
Test if you have access to a function called AfxCheckMemory(). (It is
available in later versions of their compiler, don't know if it is in
that version however).
If it is available try placing

ASSERT(AfxCheckMemory());

immediately before the call to fscanf(). If it breaks you have
previously overwritten some memory somewhere in your program where that
should not happen...

Jun 23 '07 #20
On Jun 22, 7:28 pm, Barry Schwarz <schwa...@doezl.netwrote:
If you keep posting to irrelevant groups, no one will want to help
you.
The problem is that I am not sure if it a problem with my C code or a
problem with MS Visual C++.

Jun 24 '07 #21
PeterOut wrote:
Barry Schwarz <schwa...@doezl.netwrote:
>If you keep posting to irrelevant groups, no one will want to
help you.

The problem is that I am not sure if it a problem with my C code
or a problem with MS Visual C++.
Look at line 42.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 25 '07 #22
On Sun, 24 Jun 2007 07:04:37 -0700, PeterOut <Ma**********@excite.com>
wrote:
>On Jun 22, 7:28 pm, Barry Schwarz <schwa...@doezl.netwrote:
>If you keep posting to irrelevant groups, no one will want to help
you.

The problem is that I am not sure if it a problem with my C code or a
problem with MS Visual C++.
Now you are just being disingenuous. In spite of the product name,
your code was C, not C++. The product contains both compilers. But
you already new that since you were compiling C code. And you
certainly didn't invoke any tools. That eliminates two of the
extraneous newsgroups. And since you already know there is a
collection of Microsoft newsgroups, you could have found the one that
deals with the Microsoft version of the language pretty easily.
Remove del for email
Jun 25 '07 #23
On Jun 23, 2:50 pm, Johan Bengtsson <qwerty...@hotmail.comwrote:
PeterOut wrote:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2).
I am not sure if this is a C, C++ or MS issue but fscanf has been
randomly hanging on me. I make the call hundreds, if not thousands,
of times but it hangs in different places with the same data. The
offending code follows.
ReadFile(char *csFileName)
{
float fFloat1, fFloat2;
long lLong1, lLong2, lNum, lLastX = iColumns-1, lLastY =iRows-1;
int iRead;
FILE *fpInFile;
if ((fpInFile= fopen(csFileName, "r")) == NULL) return
ErrorOpeningFile(csFileName);
do
{
// It randomly hangs on the followinf
line
iRead=fscanf(fpInFile, "%d%d%f%f%d", &lLong1, &lLong2, &fFloat1,
&fFloat2, &lNum);
if (iRead==0 || iRead==EOF) break;
} while (lX < lLastX || lY < lLastY);
}
I am wondering if I should just do binary reading so as to have more
control over what is going on.
Many thanks in advance for any assistance,
Peter.

Hmmm, I was thinking that it might be a consequence of corrupt memory
(like buffer overruns, changing memory after free() (or equivalent) or
some other similar problem).
Test if you have access to a function called AfxCheckMemory(). (It is
available in later versions of their compiler, don't know if it is in
that version however).
If it is available try placing

ASSERT(AfxCheckMemory());

immediately before the call to fscanf(). If it breaks you have
previously overwritten some memory somewhere in your program where that
should not happen...- Hide quoted text -

- Show quoted text -
Hi Johan,

That looks likfe a handy function. Thanks for bringing it to my
attention. I put it in and it didn't flag anything. I have decided
to give up on fscanf and add the following code instead.

ERROR_NUMBER FReadLine(FILE *fpInputFile, char *csBuffer)
{
int i;

if ((csBuffer[0] = fgetc( fpInputFile )) == EOF) return
ERROR_READING_FILE;
i = (csBuffer[0] == '\n')? 0 : 1;
while ((csBuffer[i] = fgetc( fpInputFile )) != '\n')
{
if (csBuffer[i++] == EOF) return ERROR_READING_FILE;
}
csBuffer[i] = '\0';

return ERROR_NONE;
}

if ((fpFile = fopen(csFileName, "r")) == NULL)
{
// Error handling
}
{
float fMean;
long lX, lY, lLastX = fppPlane->iColumns-1, lLastY = fppPlane-
>iRows-1;
char csBuffer[32];

do
{
if ((enErrorNumber=FReadLine(fpFile, csBuffer))!=ERROR_NONE) break;
lX=atoi(strtok(csBuffer, "\t"));
lY=atoi(strtok(NULL, "\t"));
fMean=(float)atof(strtok(NULL, "\t"));
} while (lX < lLastX || lY < lLastY);
}
fclose(fpFile);

So far no problem.

Thanks again for your help,
Peter.

Jun 26 '07 #24
On Jun 24, 11:10 am, CBFalconer <cbfalco...@yahoo.comwrote:
PeterOut wrote:
Barry Schwarz <schwa...@doezl.netwrote:
If you keep posting to irrelevant groups, no one will want to
help you.
The problem is that I am not sure if it a problem with my C code
or a problem with MS Visual C++.

Look at line 42.
Of what?

Jun 26 '07 #25
On Mon, 25 Jun 2007 19:15:44 -0700, PeterOut <Ma**********@excite.com>
wrote:

snip obsolete code that should not have been quoted
>
Hi Johan,

That looks likfe a handy function. Thanks for bringing it to my
attention. I put it in and it didn't flag anything. I have decided
to give up on fscanf and add the following code instead.

ERROR_NUMBER FReadLine(FILE *fpInputFile, char *csBuffer)
{
int i;

if ((csBuffer[0] = fgetc( fpInputFile )) == EOF) return
ERROR_READING_FILE;
i = (csBuffer[0] == '\n')? 0 : 1;
while ((csBuffer[i] = fgetc( fpInputFile )) != '\n')
{
if (csBuffer[i++] == EOF) return ERROR_READING_FILE;
}
csBuffer[i] = '\0';

return ERROR_NONE;
}
This sure seems like a lot of work just avoid calling fgets.
>
if ((fpFile = fopen(csFileName, "r")) == NULL)
{
// Error handling
}
{
float fMean;
long lX, lY, lLastX = fppPlane->iColumns-1, lLastY = fppPlane-
>>iRows-1;
char csBuffer[32];
Is 32 bytes really sufficient to hold the longest line in your file?
>
do
{
if ((enErrorNumber=FReadLine(fpFile, csBuffer))!=ERROR_NONE) break;
lX=atoi(strtok(csBuffer, "\t"));
lY=atoi(strtok(NULL, "\t"));
fMean=(float)atof(strtok(NULL, "\t"));
The cast is superfluous.
> } while (lX < lLastX || lY < lLastY);
}
fclose(fpFile);

So far no problem.
So you have managed to camouflage the problem with no understanding of
what the real issue was?
>
Thanks again for your help,
Peter.

Remove del for email
Jun 26 '07 #26
PeterOut said:
On Jun 24, 11:10 am, CBFalconer <cbfalco...@yahoo.comwrote:
>PeterOut wrote:
Barry Schwarz <schwa...@doezl.netwrote:
>If you keep posting to irrelevant groups, no one will want to
help you.
The problem is that I am not sure if it a problem with my C code
or a problem with MS Visual C++.

Look at line 42.
Of what?
Precisely his point, I think.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 26 '07 #27
On Mon, 25 Jun 2007 19:18:21 -0700, in comp.lang.c , PeterOut
<Ma**********@excite.comwrote:
>On Jun 24, 11:10 am, CBFalconer <cbfalco...@yahoo.comwrote:
>PeterOut wrote:
Barry Schwarz <schwa...@doezl.netwrote:
>If you keep posting to irrelevant groups, no one will want to
help you.
The problem is that I am not sure if it a problem with my C code
or a problem with MS Visual C++.

Look at line 42.
Of what?
Precisely.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jun 26 '07 #28
On Jun 26, 12:19 am, Barry Schwarz <schwa...@doezl.netwrote:
>
This sure seems like a lot of work just avoid calling fgets.
MUCH more than worth it. I have replaced a black box that hangs with
much more transparent code that does not. If it did hang or crash, I
would have a much better idea of why.
>
Is 32 bytes really sufficient to hold the longest line in your file?
Excellent point. I will modify FReadLine() so that there is a maximum
to the number of characters that are read.
>
do
{
if ((enErrorNumber=FReadLine(fpFile, csBuffer))!=ERROR_NONE) break;
lX=atoi(strtok(csBuffer, "\t"));
lY=atoi(strtok(NULL, "\t"));
fMean=(float)atof(strtok(NULL, "\t"));

The cast is superfluous.
fMean=atof(strtok(NULL, "\t"));
warning C4244: '=' : conversion from 'double' to 'float', possible
loss of data
>
So far no problem.

So you have managed to camouflage the problem with no understanding of
what the real issue was?
I may have evaded the issue but have replaced a black box, that hangs
with no error message, with more transparent code. fscanf probably
hung because it was waiting for a particular input. It was not
suitable for this application since the expected input may not have
been in the input file. I think my modification has given me more
control and has made the code potentially more robust.

Thanks,
Peter.

Jun 30 '07 #29
PeterOut said:
On Jun 26, 12:19 am, Barry Schwarz <schwa...@doezl.netwrote:
>>
<snip>
do
{
if ((enErrorNumber=FReadLine(fpFile,
csBuffer))!=ERROR_NONE) break; lX=atoi(strtok(csBuffer,
"\t")); lY=atoi(strtok(NULL, "\t"));
fMean=(float)atof(strtok(NULL, "\t"));

The cast is superfluous.

fMean=atof(strtok(NULL, "\t"));
warning C4244: '=' : conversion from 'double' to 'float', possible
loss of data
The diagnostic message, whilst not compulsory, is useful, in that it
tells you that the conversion may not be able to retain all the
precision that would be available to you were you to use double.

Suppressing the diagnostic information is like taking the battery out of
your doorbell. There's still someone at the door, even if you can't
hear them any more.

Frankly, I'd use double. (And while I was at it, I'd use strtod instead
of atof and strtol instead of atoi.)

I certainly wouldn't pass strtok(NULL, "\t") to anything expecting a
string as an argument, in case the string you're parsing turned out to
be poorly formed.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 30 '07 #30
>On Jun 26, 12:19 am, Barry Schwarz <schwa...@doezl.netwrote:
>This sure seems like a lot of work just avoid calling fgets.
In article <11**********************@k79g2000hse.googlegroups .com>,
PeterOut <Ma**********@excite.comwrote:
>MUCH more than worth it. I have replaced a black box that hangs with
much more transparent code that does not. ...
I think Barry Schwarz's point was that you could just call fgets()
(*not* fscanf()!), instead of using another 15 or so lines of code
to re-implement fgets().
>I may have evaded the issue but have replaced a black box, that hangs
with no error message, with more transparent code. fscanf probably
hung because it was waiting for a particular input. It was not
suitable for this application since the expected input may not have
been in the input file.
Actually, fscanf() probably did *not* hang. Instead, since you
had code of the general form [%]:

some_sort_of_loop {
/* ignore result of */ fscanf(file, format, args);
if (feof(file)) break;
... do work ...
}

what would happen is that fscanf() would encounter "bad" input
and *leave the input in the stream*. The feof() test would say
"not EOF" -- fscanf() failed, yes, but not because of EOF -- and
on the next iteration, the fscanf() would again immediately
fail.

Using fgets() (instead of fscanf()) *is* a good idea. In general,
of the scanf family, the sscanf() function is the most useful /
least error-prone -- but even then there are pitfalls. Start with
fgets() (or equivalent), then break up the resulting lines as
desired, using sscanf() or the strto* functions, or whatever.

[% Any time anyone ignores the return value of an input-reading
function, whether that is one of the scanf family, or fgets(), or
getchar(), or whatever it may be, this is a nearly-certain sign
that the code is wrong. But at least the loop above avoids the
even more common beginner's error, which is to call feof() *before*
calling an input-reading function. Since feof() only tells you
*why* a previous read failed -- it has to be one that already failed
-- calling it *before* observing such a failure is just asking for
trouble. Calling it after observing failure is still somewhat
suspect, since many people seem not to realize that Standard C
provides for exactly two separate kinds of failure: "failure due
to ordinary end of file", for which feof() will say "yes" and
ferror() will say "no", and "failure due to bad floppy disk, or
cpu catching fire, or any other not-ordinary-EOF-disaster", for
which feof() will say "no" and ferror() will say "yes".]
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Jul 5 '07 #31
Chris Torek said:

<snip>
[...] many people seem not to realize that Standard C
provides for exactly two separate kinds of failure: "failure due
to ordinary end of file", for which feof() will say "yes" and
ferror() will say "no",
....sure.
and "failure due to bad floppy disk, or
cpu catching fire, or any other not-ordinary-EOF-disaster", for
which feof() will say "no" and ferror() will say "yes".]
Okay, okay, I hear you, but wait a minute... As the chicken says:

Ginger: Listen. We'll either die free chickens or we die trying.
Babs: Are those the only choices?

That is, does the Standard guarantee that (feof(fp) && ferror(fp))
evaluates to 0? Is there not scope for some condition in which, say, 32
bytes were requested, there were only 30 bytes left on the file, so EOF
would certainly be encountered, and only 16 bytes could be read because
the next bit of the file was in a bad sector, so that both Bad Things
are happening at once?

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jul 5 '07 #32
In article <Xs*********************@bt.com>
Richard Heathfield <rj*@see.sig.invalidwrote:
>... That is, does the Standard guarantee that (feof(fp) && ferror(fp))
evaluates to 0?
Definitely not. In particular, since the error indicators are
"sticky" -- that is, they require use of clearerr(fp) to clear them
-- we could certainly have, for instance:

int c1, c2;
c1 = getc(stdin);
c2 = getc(stdin);

set both c1 and c2 to EOF, with the first EOF being due to the user
pressing the system's "EOF key" (^D or ^Z or whatever) and the
second being due to the user logging off ("terminating the session",
or whatever the system calls it). The first might set feof(fp),
and the second set ferror(fp).

I meant after a single error, but even then I am not sure:
>Is there not scope for some condition in which, say, 32
bytes were requested, there were only 30 bytes left on the file, so EOF
would certainly be encountered, and only 16 bytes could be read because
the next bit of the file was in a bad sector, so that both Bad Things
are happening at once?
That seems plausible.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Jul 5 '07 #33
On Jul 5, 1:31 am, Chris Torek <nos...@torek.netwrote:
On Jun 26, 12:19 am, Barry Schwarz <schwa...@doezl.netwrote:
This sure seems like a lot of work just avoid calling fgets.

In article <1183227072.734131.307...@k79g2000hse.googlegroups .com>,

PeterOut <MajorSetb...@excite.comwrote:
MUCH more than worth it. I have replaced a black box that hangs with
much more transparent code that does not. ...

I think Barry Schwarz's point was that you could just call fgets()
(*not* fscanf()!), instead of using another 15 or so lines of code
to re-implement fgets().
Yes, I can see your point. I essentially re-implemented fgets() after
I added the maximum number of bytes to read. I will use fgets() since
it has probably been tested and optimized a lot more thoroughly than
my re-implemtation. I will also tryi using sscanf instead of
strtok(). However, it is beginning to appear that my problem is a
deadlock which tends to arise in multihtreaded programming.

Thanks,
Peter.
Jul 11 '07 #34
Richard Heathfield <rj*@see.sig.invalidwrites:
Suppressing the diagnostic information is like taking the battery out of
your doorbell.
Doorbells are battery-powered in England? Yet another way that
it's such a foreign country...
--
Ben Pfaff
http://benpfaff.org
Jul 11 '07 #35
Ben Pfaff wrote, On 11/07/07 03:28:
Richard Heathfield <rj*@see.sig.invalidwrites:
>Suppressing the diagnostic information is like taking the battery out of
your doorbell.

Doorbells are battery-powered in England?
Some of them are, some are not.
Yet another way that
it's such a foreign country...
No, yours is the foreign country, what's worse it is full of foreigners ;-)
--
Flash Gordon
Jul 11 '07 #36
Ben Pfaff said:
Richard Heathfield <rj*@see.sig.invalidwrites:
>Suppressing the diagnostic information is like taking the battery out
of your doorbell.

Doorbells are battery-powered in England?
Well, some are, yes. And some aren't. And some, like mine, or more sort
of kinda. My setup is as follows:

On the door, a box for the pushbutton. It contains a battery and a radio
transmitter.

In the kitchen, a box plugged into the mains. It contains a radio
receiver and the actual speaker.

It's a completely wireless system. Even the sound box has no power cable
- the three pins are right there on the box, so you just stick it in
the wall.

The only minor disadvantage is that, when you first install it, you have
to fiddle around with the channel settings a bit to avoid clashing with
other similar radio devices in the area. It can take a few days to work
out the best channel. Apart from that, though, it's great.

Yet another way that it's such a foreign country...
England isn't foreign. You must be thinking of somewhere else.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jul 11 '07 #37
Ben Pfaff wrote:
Richard Heathfield <rj*@see.sig.invalidwrites:
>Suppressing the diagnostic information is like taking the battery
out of your doorbell.

Doorbells are battery-powered in England? Yet another way that
it's such a foreign country...
Some are in the USA also. A battery is considerably cheaper than a
transformer, and works even when the power is out! This is
magnified when the mains are 250 VAC. Of course, with the usual
lack of maintenance, the doorbells don't work.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jul 11 '07 #38

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Psibur | last post by:
Hello, trying to get back into c and was having issue with reading a simple text file with an aribtrary # of lines with 3 int's per line, with the eventual purpose of putting each int into an...
7
by: Thomas Sourmail | last post by:
Hi, I hope I am missing something simple, but.. here is my problem: I need my program to check the last column of a file, as in : a b c d target ref 0 0 0 0 1 a 1 0 0 0 1.5 b 2 0 0 0 2 c
13
by: PeterOut | last post by:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2). I am not sure if this is a C, C++ or MS issue but fscanf has been randomly hanging on me. I make the call hundreds, if not thousands, of...
59
by: David Mathog | last post by:
Apologies if this is in the FAQ. I looked, but didn't find it. In a particular program the input read from a file is supposed to be: + 100 200 name1 - 101 201 name2 It is parsed by reading...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.