15,908,115 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 12549902 (Top 24 by date)
Member 12549902
31-May-16 10:42am
View
void HousingRegister::printBythePrice(string *array, int araylenght, float max)const {
int index = 0;
for (index = 0; index <araylenght; i++)
="" {
="" if="" (housing[i]-="">getRent() <= max)
{
array[index] = housing[i]->toString();
index++;
}
}
}
Member 12549902
31-May-16 10:28am
View
Så true.. well said. Thank you så much
Member 12549902
31-May-16 10:09am
View
Can you please cheek my code that i wrote, before?
Mabey thats is the sulution? on the top of the page.
Member 12549902
31-May-16 10:04am
View
Index hast to point to some adress? i Just need to delete this line
house.getnrOfHouses()==index;
Sorry my english i not my first lenguage. Hope you understand me.
Member 12549902
31-May-16 9:59am
View
for(int i; i
Member 12549902
31-May-16 9:57am
View
Deleted
void HousingRegister::printBythePrice(string *array, int arrayLength, float max)const {
int index = 0;
for (int i = 0; i <arraylength; i++)="" {="" if="" (housing[i]-="">getRent() <= max)
{
array[index] = housing[i]->toString();
index++;
}
}
}
Member 12549902
31-May-16 9:50am
View
void HousingRegister::printBythePrice(string *array, int arrayLength, float max)const {
int index = 0;
for (int i = 0; i <nrofhouses; i++)
="" {
="" if="" (housing[i]-="">getRent() <= max)
{
array[index] = housing[i]->toString();
index++;
arrayLenght=index;
}
}
}
Member 12549902
31-May-16 9:46am
View
I don't mean here, here is everyone nice, thank you for your patience and good exponation, it's me that i am dumb.
Member 12549902
31-May-16 9:40am
View
The length is nrOfelements as i have, writen: nrOfHouses.
and house.getnrOfHouses() int the other func
Yeah i know you are not the frist saying i am the worse. I hear that often.
Member 12549902
31-May-16 9:35am
View
As parameters i have (string *array, float max)
So you mean i should have the index as parameter too?
void printByprice(string* array, int *index ,float max)
Member 12549902
31-May-16 9:28am
View
you mean array[index]?
Member 12549902
31-May-16 9:22am
View
void printBythePrice(const HousingRegister &house){
float max;
int index = 0;
string *arr = new string[house.getnrOfHouses()];
cout << "Enter the price: ";
cin >> max;
house.printBythePrice1(arr, &index, max);
house.getnrOfHouses()==index;
for (int i = 0; i < house.getnrOfHouses(); i++)
{
cout << arr[i];
}
delete[] arr;
}
void printStrings(string stringArray[], int nrOfStrings)
{
for (int i = 0; i < nrOfStrings; i++)
{
cout << endl << stringArray[i] << endl;
}
}
void HousingRegister::printBythePrice(string *array, int *index, float max)const {
for (int i = 0; i <nrofhouses; i++)="" {
="" if="" (housing[i]="">getRent() <= max)
{
array[*index] = housing[i]->toString();
index++;
}
}
}
Like this you mean? I am really tring evrything to learn doing my best, studing 8 h a day 5 days a week, some learn fast same learn slow. I am not lazzy person. I want to learn, this function works good, but i know there is a better way of fixing this. I trying i am doing my best, thats why i am asking for help. I am sorry if i look like a lazzy person, but i am just a bigginer in c++.
Member 12549902
31-May-16 3:36am
View
Plz give me an exemple code how you wuold inplement it?
Member 12549902
31-May-16 2:47am
View
Both are conected. Need to print all houses that has the rent price less than the abount i wrote.
Would you inplement such a code.. without empty plases, and not getin garbage, uninitialized memory?
I am sorry for this stupit question but i am new att programing and i dont understand all.
Member 12549902
30-May-16 20:29pm
View
Thank you, can you give me an exempel you can you inplement it?
Plz i have tried how to fix it for more than 3 weeks and i didnt succed.
Member 12549902
30-May-16 20:09pm
View
it is the wrong size of the array. You need to implement functionality so you do not have empty places at the end of the array. This is my question? Can you fix this mistake? cheek this code careful. i need an answer buy tonight
Member 12549902
27-May-16 8:26am
View
Well great.. it works.
Thank you so much CPallini for the help.. you have been very patient explaining and very clear.
I wish you good weekend.
Member 12549902
27-May-16 7:54am
View
The function works great but i still got this coments i sent it to you..
Member 12549902
27-May-16 7:52am
View
First mistake: mismatches in arrays.
second mistake:
function expects a string * arr filling with data, but you submit a common variable instead of an array.
Member 12549902
27-May-16 7:30am
View
Deleted
Thank you for the answer.. i think you are very clear, but i am a dum programer and i dont understand it how to inplement the code. :(
I have been tring to fix this 3 days and i dont get it.
I dont know how to arr[i] = "foo"; or where to put this part of the code.
I hope you can give me an conkrete exmpel, you can use my code.
If you cant do that i understand.
Best regards
Alfons
Member 12549902
27-May-16 7:01am
View
Do you meant like this?
string arr[100]={};
If i am doing wrong again.. can you please sent me a code exempel how you think?
As i said before i am biginer and i want to learn as much as posible.
I have 3 days tring to fix this but i cant fix it.
Member 12549902
27-May-16 6:51am
View
Thank you again for the asnwer:
Am i doing wright this time?
I am sorry i am a biginer on the programing..
void printBythePrice(const HousingRegister &house){
float max;
string arr[100];
cout << "Enter the price";
cin >> max;
house.printBythePrice(arr, max);
for (int i = 0; i < house.getnrOfHouses(); i++)
{
cout << arr[i];
}
}
Member 12549902
27-May-16 6:32am
View
Thank you for the answer, How can can i fix it? Can you please, give me an exempel?
Member 12549902
27-May-16 6:21am
View
Anyone who knows what i am doing wrong?
Show More