473,320 Members | 1,910 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,320 software developers and data experts.

heey can someone help me with these

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #define N 16
  3. #define FILENAME "exp1.txt"
  4.  
  5.  
  6.  
  7. int main(void)
  8. {
  9.     int k,count=0;
  10.  
  11.     double y[N];
  12.  
  13.     FILE *exp;
  14.  
  15.     exp=fopen(FILENAME,"r");
  16.  
  17.     if (exp == NULL)
  18.  
  19.         printf("error opening input file.\n");
  20.  
  21.     else
  22.     {
  23.  
  24.         for(k=0;k<=N-1;k++)
  25.  
  26.         {
  27.             fscanf(exp,"%lf",&y[k]);
  28.  
  29.             count++;
  30.  
  31.         }
  32.  
  33.         printf("the number is : %i\n",count);
  34.  
  35.         fclose(exp);
  36.     }
  37.  
  38.     return 0;
  39.  
  40. }


im getting runtime error
May 23 '07 #1
2 1091
Savage
1,764 Expert 1GB
#include<stdio.h>
#define N 16
#define FILENAME "exp1.txt"



Expand|Select|Wrap|Line Numbers
  1. int main(void)
  2. {
  3.     int k,count=0;
  4.  
  5.     double y[N];
  6.  
  7.     FILE *exp;
  8.  
  9.     exp=fopen(FILENAME,"r");
  10.  
  11.     if (exp == NULL)
  12.  
  13.         printf("error opening input file.\n");
  14.  
  15.     else
  16.     {
  17.  
  18.         for(k=0;k<=N-1;k++)
  19.  
  20.         {
  21.             fscanf(exp,"%lf",&y[k]);
  22.  
  23.             count++;
  24.  
  25.         }
  26.  
  27.         printf("the number is : %i\n",count);
  28.  
  29.         fclose(exp);
  30.     }
  31.  
  32.     return 0;
  33.  
  34. }

im getting runtime error
What type of runtime error?

(I runed trough ur code and it was runtime error free)

And please use code tags when posting ur code.

Savage
May 23 '07 #2
sicarie
4,677 Expert Mod 4TB
Please take a look at the Posting Guidelines, specifically the parts about asking specific questions, including errors you are getting, using good titles, and using code tags. Thanks!
May 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

114
by: muldoon | last post by:
Americans consider having a "British accent" a sign of sophistication and high intelligence. Many companies hire salespersons from Britain to represent their products,etc. Question: When the...
6
by: Ken Varn | last post by:
Sometimes when I try to close my managed C++ application, the following dialog displays in Win 2000 Pro: The title of the dialog is "Server Busy". The message is "This action cannot be completed...
2
by: sparks | last post by:
ok I was trying to do something real simple I thought Me.Clinic.DefaultValue = Me.Clinic.Value I got error either ! or . misused or not found...something like that I thought ok how can you not...
20
by: nicolas.riesch | last post by:
I try to understand strict aliasing rules that are in the C Standard. As gcc applies these rules by default, I just want to be sure to understand fully this issue. For questions (1), (2) and...
5
by: Miles Keaton | last post by:
I'm switching to PostgreSQL from MySQL. Using the SAMs book called PostgreSQL which has been great to skim the surface of the differerences. I had never even heard of things like triggers,...
14
by: ThazKool | last post by:
I want to see if this code works the way it should on a Big-Endian system. Also if anyone has any ideas on how determine this at compile-time so that I use the right decoding or encoding...
7
by: Ross Culver | last post by:
I need to ensure that session variables are removed whenever someone leaves my web site. My understanding is that this should be happening automatically with the session mode set to InProc. But...
7
by: Jurgen Haan | last post by:
Hi there. Recently, one of our application servers is moaning about its handles. (no more handles available). I'm guessing it has to do with some bug in our software where it does not release...
1
by: ramprat | last post by:
I am using a Dlookup to pull a value from my traffic table for a record prior to moving that record to a traffic_history table. I want to take the value and store it in a variable and then populate a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.