Hey guys, the following code is part of a program I am working on and as a newbie to c++ I have come across a problem. As you can see when the case is J the int J is increased by 1 but how do I go about doing this if for example instead of J I want to use JJ?
Thanks in advance for any help.
ifstream file("c:\file.txt");
if (file.is_open())
{
while (! file.eof() )
{
while (file.get(ch))
{
switch (ch) {
case 'j':
J++;
}
}
}
}