When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
17 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
here is the string.cpp
String.cpp
#include "String.h"
String::String()
{
}
String::String(const char* _str)
{
}
String::String(const String& _other)
{
}
String::~String()
{
}
size_t String::Length() const
{
return size_t();
}
String& String::Append(const String& _str)
{
// TODO: insert return statement here
}
String& String::ToLower()
{
// TODO: insert return statement here
}
String& String::ToUpper()
{
// TODO: insert return statement here
}
int String::FindCharacter(const char _chr)
{
return 0;
}
int String::Replace(const char _find, const char _replace)
{
return 0;
}
String& String::ReadFromConsole()
{
// TODO: insert return statement here
}
String& String::WriteToConsole()
{
// TODO: insert return statement here
}
bool String::operator==(const String& _other)
{
return false;
}
char& String::operator[](size_t _index)
{
// TODO: insert return statement here
}
const char& String::operator[](size_t _index) const
{
// TODO: insert return statement here
}
String& String::operator=(const String& _str)
{
// TODO: insert return statement here
}
bool String::operator<(const String& _str)
{
return false;
}
I'm like super new to this and any help will be greatly appreciated thanks.
@solid ruin Has your question been resolved? If so, type !solved :)
I would start with implementing the constructors
If you have specific questions on the parts you're confused, it's easier for people to help you
I mean this definitely seems like something the course work should have prepared you for. We can help with specific issues and questions of course.
Im struggling to know where or how to start It where i put char* data; im I going the right direction?
the lectures only really covered the definition of syntax but not much in a way of tutorials or practices which is why imconfused on where or how to start this
If you look carefully at the code they gave you, you will see clues on what data members the String class should have
Specifically look at the constructors and the getters and setters (think you only have getters in here though)
And, yea, you’re heading in the right direction but still have a lot of work to do
thanks for the tips 🙂
np
for the string.cpp for the return staments section im just calling whats been writting String.h?
Wdym by that?
string.cpp is where you implement the public constructors and member functions in this case
ok thank you