You are here:

C++/controlling the working of hardware through c/c++

Advertisement


Question
i've been given a question that whatever i write as a string on runnig tym it should be displayed in capital letters,, in short the working of caps lock key is to be controlled through c++, how it can be done?
also please suggest me some book in which it has been given that how to control the working of hardware devices through c/c++, thnx :-)

Answer
For capitalizing the strings you can use this program:


// convert the string in upper case letter
# include <iostream>
using namespace::std;
void makeUpper(char str[])
{   
  char i=0;
  while (str[i]!=0)
  {
     if (str[i]>'a'||str[i]<'z')
     cout<<static_cast<char>(static_cast<int>(str[i])-32);
     i++;
  }
  cout<<endl;
}
int main (void)
{
  char string[10];
  cout<<"Enter a word ";
  cin>>string;
  makeUpper(string);
  return 0;
}

Hardware is not my field and I don't know much about that but what I know is that programming hardware devices directly is mostly done through C. Learn to program in C and then you can move on to read any book on micro-controllers which are used in all hardware devices.

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Tehreem

Expertise

I can answer questions related to C++ coding and programming techniques.

Experience

I am a C++ programmer.

Organizations
University of Engineering & Technology Lahore

Publications
http://recurseit.blogspot.com

Education/Credentials
I am doing BSCS.

©2016 About.com. All rights reserved.