PLEASE NOTE: the upgrades to this server,, have not yet been completed.
Hopefully the changes will be completed on THURSDAY 8th December.
Web-based programs, such as csmarks, cssubmit, and the help fora, will be unavailable at some time on Thursday 8th.
  It's UWAweek 49


This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Displaying the 3 articles in this topic
Showing 3 of 919 articles.
Currently no other people reading this forum.

 UWA week 31 (2nd semester, week 2) ↓
SVG not supported

Login to reply

1:04pm Sat 6th Aug, ANONYMOUS

Hi, I'm trying to print an integer in between two strings but I'm getting an error that says "warning: too many arguments for format [-Wformat-extra-args] (as attached below) but I'm not sure what I'm supposed to do. My code is as follows: printf ("%dReceives", i, "x 50 cent coins. \n"), store; I'm trying to basically print out the amount of (i) 50 cent coins the user receives but also include it in this sentence. Help would be appreciated, thanks.

This article has 1 attachment:


SVG not supported

Login to reply

2:58pm Sat 6th Aug, Matthew C.

It should be: printf("Receives %d x 50 cent coins\n", i);

SVG not supported

Login to reply

7:20am Sun 7th Aug, Christopher M.

I suggest that, when using C's standard I/O formatting functions, that you use %i instead of %d when dealing with integers. For printf() there is no difference, but when reading input with scanf() %i is a better choice as it makes the handling of decimal, octal, and hexadecimal input (frequently used in systems-programming) much easier. Always use %i and you'll have think about it again.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy