1<html lang="en"> 2<head> 3<title>toupper - Untitled</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Untitled"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Ctype.html#Ctype" title="Ctype"> 9<link rel="prev" href="tolower.html#tolower" title="tolower"> 10<link rel="next" href="iswalnum.html#iswalnum" title="iswalnum"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<meta http-equiv="Content-Style-Type" content="text/css"> 13<style type="text/css"><!-- 14 pre.display { font-family:inherit } 15 pre.format { font-family:inherit } 16 pre.smalldisplay { font-family:inherit; font-size:smaller } 17 pre.smallformat { font-family:inherit; font-size:smaller } 18 pre.smallexample { font-size:smaller } 19 pre.smalllisp { font-size:smaller } 20 span.sc { font-variant:small-caps } 21 span.roman { font-family:serif; font-weight:normal; } 22 span.sansserif { font-family:sans-serif; font-weight:normal; } 23--></style> 24<link rel="stylesheet" type="text/css" href="../cs.css"> 25</head> 26<body> 27<div class="node"> 28<a name="toupper"></a> 29<p> 30Next: <a rel="next" accesskey="n" href="iswalnum.html#iswalnum">iswalnum</a>, 31Previous: <a rel="previous" accesskey="p" href="tolower.html#tolower">tolower</a>, 32Up: <a rel="up" accesskey="u" href="Ctype.html#Ctype">Ctype</a> 33<hr> 34</div> 35 36<h3 class="section">3.14 <code>toupper</code>—translate characters to uppercase</h3> 37 38<p><a name="index-toupper-125"></a><a name="index-g_t_005ftoupper-126"></a><strong>Synopsis</strong> 39<pre class="example"> #include <ctype.h> 40 int toupper(int <var>c</var>); 41 int _toupper(int <var>c</var>); 42 43</pre> 44 <p><strong>Description</strong><br> 45<code>toupper</code> is a macro which converts lowercase characters to uppercase, 46leaving all other characters unchanged. It is only defined when 47<var>c</var> is an integer in the range <code>EOF</code> to <code>255</code>. 48 49 <p>You can use a compiled subroutine instead of the macro definition by 50undefining this macro using `<code>#undef toupper</code>'. 51 52 <p><code>_toupper</code> performs the same conversion as <code>toupper</code>, but should 53only be used when <var>c</var> is known to be a lowercase character (<code>a</code>–<code>z</code>). 54 55 <p><br> 56<strong>Returns</strong><br> 57<code>toupper</code> returns the uppercase equivalent of <var>c</var> when it is a 58character between <code>a</code> and <code>z</code>, and <var>c</var> otherwise. 59 60 <p><code>_toupper</code> returns the uppercase equivalent of <var>c</var> when it is a 61character between <code>a</code> and <code>z</code>. If <var>c</var> is not one of these 62characters, the behaviour of <code>_toupper</code> is undefined. 63 64 <p><br> 65<strong>Portability</strong><br> 66<code>toupper</code> is ANSI C. <code>_toupper</code> is not recommended for portable programs. 67 68 <p>No supporting OS subroutines are required. 69 70 <p><br> 71 72 </body></html> 73 74