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

"processor fault"

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. main()
  3. {
  4.   int mark[25][4],j,i;
  5.   for(j=0;j<25;j++)
  6.   {
  7.     for(i=0;i<4;i++)
  8.     {
  9.       printf("\nEnter you marks\n");
  10.       scanf("%d",marks[j][i]);
  11.     }
  12.   }
  13. }
  14.  
This is a simple program of inputing marks in the four tests for each of the 25 students. But when i run it, it only ask one time to input the marks and then it shows a message "processor fault". What is i am doing wrong here, plz help.
Sep 23 '07 #1
2 2090
Banfa
9,065 Expert Mod 8TB
scanf takes a pointer not an integer so you need

Expand|Select|Wrap|Line Numbers
  1.       scanf("%d",&marks[j][i]);
  2.  
Also main returns int and not doing so invokes undefined behaviour, anything may happen.
Sep 23 '07 #2
scanf takes a pointer not an integer so you need

Expand|Select|Wrap|Line Numbers
  1.       scanf("%d",&marks[j][i]);
  2.  
Also main returns int and not doing so invokes undefined behaviour, anything may happen.
Thanks for pointing out that stupid mistake, I don't believe how i missed it.Thanks for helping.
Sep 23 '07 #3

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

Similar topics

10
by: gregory_may | last post by:
I have an application I created called "JpegViewer.exe". It simply loads a Jpeg file and displays in on the screen. It works great, in my lab. When I am using it at a customer site, things...
77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
9
by: Maksim Kasimov | last post by:
Hello, my programm sometime gives "Segmentation fault" message (no matter how long the programm had run (1 day or 2 weeks). And there is nothing in log-files that can points the problem. My...
28
by: Robert Gamble | last post by:
I was taking a look at some of the C puzzles at: http://purana.csa.iisc.ernet.in/~gkumar/cquestions.html and have not had any trouble with any of them except for the first one which is reproduced...
35
by: Sunil | last post by:
Hi all, I am using gcc compiler in linux.I compiled a small program int main() { printf("char : %d\n",sizeof(char)); printf("unsigned char : ...
42
by: Holger | last post by:
Hi guys Tried searching for a solution to this, but the error message is so generic, that I could not get any meaningfull results. Anyways - errormessage:...
93
by: jacob navia | last post by:
In this group there is a bunch of people that call themselves 'regulars' that insist in something called "portability". Portability for them means the least common denominator. Write your code...
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
0
by: vendejp | last post by:
I intermittently get the following error when calling a soap method: "HTTP" - Error Fetching http headers. Its really hit or miss... sometimes it works sometimes not. The exception doesn't...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.