i want to send 300 constant values to an array and i defined it in this way code unsigned int a[]= '' 936, 956, 1100, 1208, 1150, 986''; // like these all 300 values
but keil software gives error in these ''''' and say unspecified... pls tell me how can i store large constant values in an array??
not the first time someone has 'jumped into' C and, at the first snag, posted here. I appreciate that nobody can learn all about C by taking a course or reading a book, but for a newbie, the first resource should be checking the book. I can not imagine any C book that does not have an example of an array initialized by numeric constants.
Why cant the newbies realize that taking a look in the book is a lot faster than waiting for a reply here (especially when the answer is "look in the book").
now, I do realize that there are issues that can be extremely difficult to solve by "checking the book" and I am not discouraging such be posted here, but simple, basic things where the answer will be (in this case) found by a quick look at the examples in the chapter 'arrays' should be handled by looking in the book
Erik
unsigned int a[]= { 936, 956, 1100, 1208, 1150, 986 };
OP posted 1-May-2013 03:44 GMT Westonsupermare Pier let the cat out of the bag 1-May-2013 17:57 GMT
so it cost the OP 14 hours 13 min not to look in a book
hp how's that for productivity
some of you professionals take being awkward to a whole new level
I've suffered through my own share of inept teachers, perhaps the experiment here is to impart the right information, to the right neurons, at the right time.
It's not information that's required.
With the interweb we have far easier access to far more information than ever before.
The problem seems to be how to think about that information and apply it to problem solving.
As the old saying goes, "A good education is not about what you know, but about what you know how to find out."
Like a lot of things in real life, there are exceptions.
Sometimes people get a mental block. Where any details given become transparent and cannot be assimilated. A direct answer to a question can often clear one of these blocks and make "the penny drop".
Call me a numskull if you like, but I know I've experienced this on more than one occasion and seen others experience it too.
So, blindly following the "I won't tell you the answer, look at page XYZ" is not always the best approach.
Well, the people whu just happens to be stuck are normally able to describe their problem and what they have tried. And how they are stuck.
When a person who are willing to solve his own problems but still gets stuck visits a forum, (s)he doesn't post "Give me code" or "Please help quickly".
This thread could be solved with Google and "C array integers". But there are hundreds of search expressions that will give the answers in the top-10 links returned by Google. Most probably for most other search engines too.
Can you really see anyone so stuck that they can't consider such "advanced" search query?
As posts go, the OP didn't do too badly. He didn't say "Give me code" or "Please help quickly". He actually asked a question.
If everyone was as smart as you seem to be expecting them to be and able to find all the expected knowledge directly from the reference material, there'd be no need for anybody to post a question on a forum like this. I wonder what you'd do then?
It didn't mention any programming language
The C51 thoughtfully provided by the OP gives a reasonably good clue.
So now we know that you are reading text faster than you are processing it.
I have never claimed that it isn't obvious that this thread is about C.
But the explicit question he wrote didn't contain a programming language, which was why I said that using "pls tell me how can i store large constant values in an array??" in Google resulted in a number of links for other programming languages.
But even without a "C" in that specific question, Google still located an answer. So the OP could have posted his actual question in Google and received the answer to the question with just some minutes of link scanning.
But the explicit question he wrote didn't contain a programming language
OMG. Now I know you're just being awkward.
"The Keil Discussion Forum is an open forum where you may post questions and comments about Keil products"
OMG. Now I know you're just being awkward. ..... that this thread changed from C51 to 'none'
I have, previously wanted, in some cases to change 'none' to the actual and never succeeded, if this comes up C51 I have now succeeded
You have now succeeded!
(yes, I did deliberately change it from 'C51' to 'None' - as it was a basic syntax error, not specifically to do with C51)