This is a program to put the first 1000 numbers in an array and print out every 15th. It compiles but the program crashes.
#include <stdio.h>
int main ()
{
int array[1000];
int a=0;
Type: Posts; User: Interista
This is a program to put the first 1000 numbers in an array and print out every 15th. It compiles but the program crashes.
#include <stdio.h>
int main ()
{
int array[1000];
int a=0;
1. I know I'll get told off for not using int void main() and return 0; but when I tried using them the program wouldn't compile at all. Now it runs but puts out a strange number (i.e. when I input...
#include<stdio.h> int void main()
{
int num[3]; /*Sets array to 10*/
int count;
I changed it around as per your instructions. It wouldn't compile, then I tried it as void main() and return; and it compiled. Look, I'm not saying your wrong, obviously you know more than me, but...
Who says I haven't? I have been banging on the door of various people in the college for weeks and nothing is done. Maybe you're in America where things work much better than they do here. In America...
Perfect thanks!
I absolutely agree. If there is something easier then its that that we should use. However, our lecturer has not taught it to us yet which is ridiculous.
What you're telling me to do though is exactly what my lecturer tells me not to. This is so confusing.
This program is supposed to take a user input string and change lower case characters to upper case and vice versa. It works except that for spaces between words it puts @ and then it adds some weird...
I'm trying to get getchar to put three numbers which the user will enter as a 3 digit integer into an array. This is part of a bigger program which I believe if I can get this to work I will be able...
That's great. Thanks a million!
#include<stdio.h>
int main(){
char str[5000];
int i=0;
printf("Enter any string: ");
scanf("%s",str);
The problem is, as you suggested, he's giving us stuff which is out-of-context, in that he is not covering it. For example, he wants us to manipulate stuff but doesn't even touch on how to.
I'm...
That the user inputs three numbers which getchar gets and puts into a variable.
I really don't know anymore. There was a program I couldn't get last week and even though all marks have been given...
Hi, our assignment asks us to do something with a program where we store three inputs in one variable?
Surely the easiest way is to use an array?
But our lecturer told us an array isn't a...
Thanks! I already used TheNewBoston and found it really good, the problem is he only goes as far as what we needed for last week.
Thanks s much for that!
I'll certainly distribute it to my students.
It gets my goat a bit when experts tell us what we should know as its "so basic". Its incredibly basic for me to say, for...
And its not being lazy to not understand something and ask is there something I can read that would make more sense...
If more than one student (and most on the course are in the same boat) can't...
OK, so the fact he hasn't taught us the code for changing uppercase to lowercase is acceptable?
I'm a teacher myself and am aware of the difference between (a)teaching and (b)shouting from a...
I don't disagree.
He's covered in a very basic manner strings, input/output, getchar and for loops but he hasn't covered how to change strings from upper to lower case. Nor how to change strings...
Hi,
I'm COMPLETELY confused over my assignment for this week.
We have ten questions.
1. Change a user input string from lowercase to uppercase.
2. Turn a user input string from string to...
That's 100% true. I am a language teacher, there are millions of people who KNOW the languages I teach, far fewer who can teach them. (That doesn't mean that I believe I am a world class teacher,...
Being fair, his program did work, I was modifying it slightly to store numbers into the array, but many/most of the problems you (and other posters) highlighted were his.
Oddly that convinces me...
Thanks. I'll work away at that for a while and see where I get.
Incidentally, does this mean my suspicions about my lecturer not exactly being the best are confirmed?
I mean what you've all...
Described my feelings quite succinctly, except that I have my doubts that my lecturer actually knows what he's doing himself. I have a feeling he's waffling from a book and doesn't actually know how...