-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGT_Util.cpp
More file actions
49 lines (41 loc) · 707 Bytes
/
GT_Util.cpp
File metadata and controls
49 lines (41 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#include <stdarg.h>
#include <stdio.h>
#include "GT_Util.h"
// Makes "str" lowercase
void Lowercase(char *str)
{
if(str)
{
for(uint i = 0; i < strlen(str); ++i)
{
if(isalpha(str[i]))
str[i] = tolower(str[i]);
}
}
}
// Makes "str" uppercase
void Uppercase(char *str)
{
if(str)
{
for(uint i = 0; i < strlen(str); ++i)
{
if(isalpha(str[i]))
str[i] = toupper(str[i]);
}
}
}
void OutputError(const char *err, ...)
{
#ifdef _DEBUG
char buff[256] = {0};
va_list args;
va_start(args, err);
int count = vsprintf(buff, err, args);
va_end(args);
if(count > 0)
OutputDebugString(buff);
#endif
}