thanks for helping
also i like your trick, declaring them inside the for loops :D
Type: Posts; User: trueman1991
thanks for helping
also i like your trick, declaring them inside the for loops :D
do you mean the
{ and }
if so im just using them to break it up so its easier to understand from my point of view, cos i have like the code for opening the code so i put that in its own...
thanks, i dont spose you could use it in context, doesnt have to be with what i have here, but with some example code in it.
This is because i kinda understand what you getting at with the help of...
Hi, im currently writing a wordsearch programme and am on to the part where i need to store the information from a file into a 2D array.
This is the content of the file that i am using:
25 15...
also i was wondering how do you get it to read just the first line, because it seems to be reading the whole of the text document and not outputting anything.
This is the context of the text...
thanks both of you, solved my problem, cant belive i forgot the &, those buggers will be the death of me lol
this is what i have now:
#include <stdio.h>
int main(void)
{
char filename[25];
char wordsearch[50] [50];
int width, height;
yeah thats along the lines of it, will try that now
and the code above it just me testing, ignore the array bits on the height and width etc
that was something i forgot to remove lol
I having trouble with a programme im trying to write
I have it so it asks for a file name, opens that file if it exists or comes up with error message if it doesnt.
But what im stuck on it how...
sorry bit early on the saying it worked, it works as in doesnt display the blank lines anymore,
however it does cut off one word, so for example if i was going to type, hello world, it would...
ok thanks :)
i had me try one way and a mate try your way, and it worked great, thanks :)
ok i will try that, is the while loop instead of the for loop??
Hey im writing a programme that gets a string, and stores in in an array and then outputs each word on a single line, with no spaces and no blank lines.
So far i have this:
char line[100];
...
this is the whole programme:
#include <stdio.h>
void print_arr(int myArray[], int elements);
int sum_arr(int myArray[], int elements);
int main(void)
i changed it abit after my mate said a few things and this is the code i have now:
int numbers[12];
int count = 12;
long sumtotal = 0L;
float average = 0.0f;
int sum;
int i;
...
that is the code im using, im just updating a different copy with the stuff i know is working, e.g. basicly all of it apart from working out the max value
also did you mean put it something like this:
int numbers[12];
int count = 12;
long sumtotal = 0L;
float average = 0.0f;
int sum;
int i2 ;
int maxValue;
oh yeah lol, didnt realise the
for (i=0;i;)
Hey, me and my friend are trying to write a programme that uses an array and gets inputs from the keyboard and puts the value into the array and works on the sum/average/max number, while just using...
thanks very much :)
and yeah i know, just get use to the amount of different ways you can do things, and how certain ways make it ALOT more painful that others lol
Im currently in the process of making a programme that will read an input and then tell the user how many vowels the string has in it.
I have got it working 100% with gets code but i dont want to...
Ive managed to get it working
below is what i have done:
int number1;
int number2;
int result;
int first;
Im having trouble writing a multiplication table for C.
I have actually wrote the programme, without any user interface, however i want user interface, i want the user to be able to choose what...
Thanks, worked a charm :)
and yeah will remember next time, sorry :P
these are the errors im getting, and are both the same for both else statments
51: error: expected primary-expression before "else"
51: error: expected `;' before "else"