Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,920 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,992 people online right now. Registration is fast and FREE... Join Now!




Easy problem...pls help...:(

 
Reply to this topicStart new topic

Easy problem...pls help...:(

gatzos_barca
4 Dec, 2007 - 05:26 PM
Post #1

New D.I.C Head
*

Joined: 4 Dec, 2007
Posts: 1


My Contributions
Hello All,

I just want to ask what this programme does. Actually i know what it does, i just wanna know the exact operation of it.

CODE
char *u; //declare the string
char k;
unsigned int x; // declare integer
int i;
u = " University ";
k = u[0];

ASC0_uwGetData(); //wait to get data
x = ASC0_uwGetData(); //get character to the variable

if(x=='u')

{
for(i=0;k!=0; i++) // Read-dynamic way
{

k =u[i];
while(ASC0_ubTxBufFree() == 0) {} //wait untill buffer is not busy
ASC0_vSendData(k); //send Data

}
}



OK what i dont get is the for loop. what does it do exactly with the string(z=p[i])? Is it trying to read the word using the dynamic way? How does it do that?
The programme is supposed to read the u character when its pressed from the keyboard and the extract the word university.. I know its very simple but i'm a beginner...so pls help me!!!!

*Mod Edit: added code tags: code.gif
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Easy Problem...pls Help...:(
4 Dec, 2007 - 08:57 PM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,869



Thanked: 53 times
Dream Kudos: 550
My Contributions
Basically the program reads in an integer, if the integer is equal to 'u' then it sends " University " out another port. You can find code for ASC0_uwGetData() on Google cod search.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 02:46PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month