Forum: C Oct 14th, 2008 |
| Replies: 10 Views: 854 Here (http://www.planetoid.org/technical/samples/va_args/va_args.c) is an example of a printf using va_args. |
Forum: C Oct 7th, 2008 |
| Replies: 3 Views: 700 You should remove your scanf statements from the if {} and move them to under the while loop
Something like this will keep looping until you have the correct number. Or you could restrict the... |
Forum: C Oct 6th, 2008 |
| Replies: 8 Views: 1,098 Your variable "result" in not defined in the gcd() function. Also you need to return the result value. |
Forum: C Oct 6th, 2008 |
| Replies: 8 Views: 1,098 This
{
int result,a;
if a = 0 return b
while b ≠ 0
if a > b
a := a − b
else |
Forum: C Oct 6th, 2008 |
| Replies: 8 Views: 1,098 Well you are printing "result" without initializing it or assigning it a value. Is result supposed to be your GCD ? Then you probably want to move your print to after you have computed your GCD and... |
Forum: C Sep 30th, 2008 |
| Replies: 2 Views: 1,346 What you are doing will work i.e. RF_RXTXPAIR_SETTINGS code RF_SETTINGS[2];
If you want to dynamically assign an array size at runtime, you could do
RF_SETTINGS = malloc (number_of_elements *... |
Forum: C Sep 25th, 2008 |
| Replies: 10 Views: 1,932 paths is a pointer, as per your definition.
path_info *paths
When you do
global_routing_info[i].paths = (path_info *) malloc ( sizeof ( path_info ) );
You now have an array of paths. |
Forum: C Sep 24th, 2008 |
| Replies: 10 Views: 1,932 To access an element of the array "paths", you need to use the notation . not ->
so its
global_routing_info[neighbor].paths[no_paths].path_id = path; |
Forum: C Sep 22nd, 2008 |
| Replies: 6 Views: 606 Your tax rate for each year will be something like:
YearlyTaxRate = intial_cost * tax_rate;
Your current code states
tax_rate = ? * initial_cost;
total =... |
Forum: C Dec 2nd, 2007 |
| Replies: 11 Views: 2,524 The AIX native C compiler does not like the // comment style for .c files, since its considers it a C++ comment and not a C style comment. I think that is probably the reason you're getting the... |