Hang on, I misread you, my eye skipped over the bit where you suggest that
adding the check somehow makes the preceding fopen call succeed instead of
fail. However I still don't think that's what the OP was saying, unless the
subject line of this thread is terribly wrong, I think you just read
On 01 November 2007 15:58, Dave Korn wrote:
> On 01 November 2007 15:15, Lewis Hyatt wrote:
>
>
if (fp==NULL)
{
printf("error, NULL pointer!\n");
return(1);
}
>
>> I think what the OP is saying is that if he adds the check for null,
>> then his code
On 01 November 2007 15:15, Lewis Hyatt wrote:
>>> if (fp==NULL)
>>> {
>>>printf("error, NULL pointer!\n");
>>>return(1);
>>> }
> I think what the OP is saying is that if he adds the check for null,
> then his code works normally, including the file read operation, (ie
Dave Korn wrote:
On 01 November 2007 06:43, zirtik wrote:
After adding the line:
if (fp==NULL)
{
printf("error, NULL pointer!\n");
return(1);
}
and then rebuilding the code, everything worked. But it's strange that if I
delete that code segment a
On 01 November 2007 06:43, zirtik wrote:
> After adding the line:
>
>
> if (fp==NULL)
> {
> printf("error, NULL pointer!\n");
> return(1);
> }
>
> and then rebuilding the code, everything worked. But it's strange that if I
> delete that code segment and never
After adding the line:
if (fp==NULL)
{
printf("error, NULL pointer!\n");
return(1);
}
and then rebuilding the code, everything worked. But it's strange that if I
delete that code segment and never check whether the fp pointer is NULL or
not, I alwa
Alberto Luaces wrote:
Maybe unrelated, but:
shouldn't this
fp = fopen ("phi.txt","r");
be
fp = fopen ("phi.txt","rt");
?
It's not required, no.
--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
216 Dalt
On 31 October 2007 00:11, zirtik wrote:
> int i;
> fp = fopen ("phi.txt","r");
>
> for( i = 0; i < 51; i++ ) {
> fscanf(fp, "%d\n", &original_phi[i]);
> }
> 655 [main] Genetics 3012 _cygtls::handle_exceptions: Exception:
> STATUS_ACCESS_VIOLATION
> 2540 [mai
Maybe unrelated, but:
shouldn't this
> fp = fopen ("phi.txt","r");
be
fp = fopen ("phi.txt","rt");
?
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:
zirtik wrote:
> and when I try to compile it, it compiles well, but when I try to run it I
> get the following error message:
>
> 655 [main] Genetics 3012 _cygtls::handle_exceptions: Exception:
> STATUS_ACCESS_VIOLATION
> 2540 [main] Genetics 3012 open_stackdumpfile: Dumping stack trace to
> Gene
zirtik wrote:
Hi, I'm using cygwin and windows XP together with Eclipse IDE and CDT. I have
a following piece of code:
int i;
fp = fopen ("phi.txt","r");
for( i = 0; i < 51; i++ ) {
fscanf(fp, "%d\n", &original_phi[i]);
}
...
Hi, I'm using cygwin and windows XP together with Eclipse IDE and CDT. I have
a following piece of code:
int i;
fp = fopen ("phi.txt","r");
for( i = 0; i < 51; i++ ) {
fscanf(fp, "%d\n", &original_phi[i]);
}
...
and when I try to
12 matches
Mail list logo