Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/10/09 02:46
Read: times


 
#165209 - RE: Andy
Responding to: ???'s previous message
What examples? 
What folders? 

C:KeilC51ExamplesCSAMPLE

What emulator did you use - or do you mean the Keil uVision Simulator? 

Note that the Keil Simulator is not a real-time simulator - its speed of execution depends entirely upon your PC. 


I use the Generic 8051 (all Variants) 8051 Based CMOS or NMOS Microcontroller with 32 I/O lines, 2 Timers/Counters, 5 Interrupts/2 Priority Levels, 4K Bytes ROM, 128 Bytes on-chip RAM as a testing platform. I added STARTUP.A51 and XBANKING.A51 into my project.
Where do you think this will return to?

I don't know, that is how C is written in the book I am reading. So I thought it was okay to leave return 0 there. So it's not okay?

This is the code from my book, I am using it as a template guide but what I really want to do is handle an array (string) of chars:
#include <stdio.h>

main()
{
    int ch;
    
    printf("Please type in one char:n");
    ch = getc(stdin);
    printf("The character you just entered is: %cn", ch);
    return 0;
}


What keeps "crashing"? 
In what way does it crash?

The program will not compile code if there is too much code in main(). So how do I count how many bytes is used in main()? I saw the sample program use three different C files, so i guess I'm going to have to split my code up? But my main focus right now is to get strings working. Even testing one char it takes forever for the program to accept the input. And when it does output it backout it gives me one garbled char result.



List of 5 messages in thread
TopicAuthorDate
Program runs really slow            01/01/70 00:00      
   More detail required            01/01/70 00:00      
      RE: Andy            01/01/70 00:00      
         You are reading the wrong book!            01/01/70 00:00      
         program will not compile            01/01/70 00:00      

Back to Subject List