write c++ code that has a function int GreaterThan (int array [], int size, int searchItem). The fucntion should count and return number of elements in the array greater than SearchItem. you are free to generate the element randomly or let the user enter them, the size must be less than ten
lehlohonolo.mohaila 0 Newbie Poster
Recommended Answers
Jump to PostWhat do you need help with? What code do you have so far? If "help me please" is slang for "give me code" then you will find no one is going to "help" you.
Jump to PostThe fact that the standard forbids it.
main()
only ever returns an int.
Jump to PostThat's a great attitude to have. To have
main()
return an int is in the standard for a reason. Some systems need that value returned frommain()
for them to function correctly. Some compilers will not even compile your code because of it. Just because you use it and you …
Jump to Postyour code is even more error prone. memory leaks.
new allocation always need to be freed.
On line 16. for something simple like this, there was no need using new alloc. just simpleconst int foo=10; int afoo[foo];
something more simpler and effective for basic data …
Jump to PostI know that I worked (and still do) very hard to learn how to code a program from requirements and I feel like some of the other posters above that people who REFUSE to even try to learn to write a simple program shouldn't be getting any kind of programming …
All 19 Replies
kal_crazy 13 Junior Poster
omar.shakaa.9 0 Newbie Poster
omar.shakaa.9 0 Newbie Poster
NathanOliver 429 Veteran Poster Featured Poster
UFOOOOOOOOOOO -2 Newbie Poster
NathanOliver commented: Why would you just give him a solution? -2
UFOOOOOOOOOOO -2 Newbie Poster
Tumlee 42 Junior Poster in Training
UFOOOOOOOOOOO -2 Newbie Poster
NathanOliver 429 Veteran Poster Featured Poster
UFOOOOOOOOOOO -2 Newbie Poster
NathanOliver 429 Veteran Poster Featured Poster
richieking 44 Master Poster
Jamblaster 15 Newbie Poster
lehlohonolo.mohaila 0 Newbie Poster
lehlohonolo.mohaila 0 Newbie Poster
lehlohonolo.mohaila 0 Newbie Poster
lehlohonolo.mohaila 0 Newbie Poster
lehlohonolo.mohaila 0 Newbie Poster
happygeek 2,411 Most Valuable Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.