-
Notifications
You must be signed in to change notification settings - Fork 9
4 weeks worth of tasks for both sem and prakt #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
const size_t inputLenght=41; | ||
const size_t PlateNumLenght = 9; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const size_t inputLenght=41; | |
const size_t PlateNumLenght = 9; | |
const size_t INPUT_LENGTH = 41; | |
const size_t PLATE_NUM_LENGTH = 9; |
mitsubishi, | ||
mazda, | ||
opel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mitsubishi, | |
mazda, | |
opel | |
MITSUBISHI, | |
MAZDA, | |
OPEL |
red, | ||
green, | ||
blue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
red, | |
green, | |
blue | |
RED, | |
GREEN, | |
BLUE |
blue | ||
}; | ||
|
||
struct car{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct car{ | |
struct Car{ |
"mazda", | ||
"opel" | ||
}; | ||
const char *colors[3] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По-добре да изнесем 3 като константа отвън и долу да използваме нея вместо sizeof(brands/colors)/sizeof(char*).
ip/=16; | ||
} | ||
result[counter] = '\0'; | ||
reverseChar(result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing reverseChar, you can just add them in reverse by doing the following:
result[counter] = hex[ip / 16];
ip %=16;
size_t i =0; | ||
while(result[i] !='\0'){ | ||
std::cout<<result[i];i++; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this.
private: | ||
|
||
double Re; | ||
double Im; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good rule of thumb is to keep all the private stuff at the bottom of a class definition.
|
||
class Car | ||
{ | ||
private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the private part to the bottom.
|
||
void Complex::print()const {std::cout<<'('<<Re<<','<<Im<<")";} | ||
|
||
Complex & Complex::operator= (const Complex c){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add a clause like this to prevent unnecessary copying. We will talk about this later in the course.
if(&c == this) return *this;
Борислав Иванов
кн 1 3mi0800548