Thanks for your help guys, you cleared up my understanding alot. Also I found that the two for statements in the bubble_sort functions had ";" after them, killing the loop, so I've got it working now...
Type: Posts; User: h4rrison.james
Thanks for your help guys, you cleared up my understanding alot. Also I found that the two for statements in the bubble_sort functions had ";" after them, killing the loop, so I've got it working now...
Ok but when if i were to declare the array "array" in the main function and not use the global scope one then you could not create pointers to the array that are passed onto functions and used as...
Im a little confused with arrays, do they have to be initialized to a certain size before you can use them ? That is all I was trying to achieve with the array[temp] line. And there should be argc-1...
Im not sure why this bubble sort code isn't working at all, could someone give me a hint ?
Help would be much appreciated. Thanks.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>...
Yer you were right kcpilot, though that didnt fix the function... :S
In the end, and following the advice of the last post of the thread you linked MK27, I rewrote the function so it is now alot...
I've looked through most of the ones I could find that were C (not C++, that rules out quite alot), and they were all dealing with a single mode returned (ie an int), so they approached it...
So I'm trying to write a basic stats program with arguments as inputs, I've done min, max, and average, and median should be pretty easy, but I'm stuck on mode (most frequently occuring). I want it...
I could, except arrays of pointers still confuse me lol, I know how they work, but find it difficult to think about when programming logic with them.
On the issue of oversizing arrays slightly when...
nvm, fixed.
I've highlighted the error, incase anyone is interested, made the same mistake twice lol, forgot to allow an extra character in the each string of the array for the terminating character...
Thanks I didnt know about the isdigit() function, so Ive changed that over and fixed the returning as per matsp's advice. The roman function still isn't working properly though, for anything with a 4...
Thanks all for your help, I've condensed the decleration of the arrays down a bit, and added in support for 4's and 9's, which I realised actually fits in with the current way the program runs, only...
lol thanks for that, Im always confusing myself with arrays and counting from 0 aswell....
Also I fixed up the printf and while statement, which were meant to be within the if n > t[a] statement, so...
Im very new to C, only been doing it a few days, so no doubt I'm making this more complex than it needs to be, but im trying to write a program which will print the argument (given as an int) in...
Of course. :p
Thanks for your help.
Im new to C, and have been teaching myself for a few days now. I'm trying to write some code which will reverse the digits of a number provided as an argument when the code is run from the command...