Change wide character string to uppercase : Change Case « Wide Character String « C Tutorial






#include <stdio.h>
#include <wchar.h>

int main(void)
{
  wchar_t text[100];

  printf("\nEnter the string to be searched(less than 100 characters):\n");
  fgetws(text, 100, stdin);

  /* Convert both strings to uppercase. */
  int i;
  for(i = 0 ; (text[i] = towupper(text[i])) ; i++);

  printf("\nFirst string entered:\n%S\n", text);
}
Enter the string to be searched(less than 100 characters):
asdf

First string entered:
ASDF








16.8.Change Case
16.8.1.Change wide character string to uppercase
16.8.2.Change case