Daniele
do you suggest any resources? or do I just bust out the leaked code of old games and check those lol
Vlad
?
Would ask an actual question, lmao?
😌
i sent in ur dm
😌
/* PROBLEM STATEMENT The DSC RIT team wanted to make a very complex question for the participants on the Bug Bounty Challenge. They tried very hard but their program for the competition still had some bugs. Now they want your help to implement the following logic: You are given a string with some alphabets(a-z or A-Z) and digits(0-9). Here are the sequence of steps we are doing 1. Calculating the FREQUENCY of each digit that appeared in the string. 2. The count of each digit is stored in an array. 3. That array is passed to a function called HASH and that prints a string. 4. The string printed is your KEY for the NEXT QUESTION. Fix any bugs in this code and the DSC RIT team will give you the KEY for you to continue your journey and win the Bug Bounty Contest! INSTRUCTIONS 1. The hash function is correct and doing its job, please DO NOT MODIFY IT 2. THE INPUT is already handled for you. 3. You are supposed to fix the logic for counting the frequency of characters correctly and fix the bugs present. INPUT: Already Handled, Please don't touch the HEADER FILES. OUTPUT: 1. The OUTPUT Printed on your console is key to enter into website. 2. The OUTPUT is of the format: XXXXXXXohw */ #include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <ctype.h> #include "helpers.h" int main() { char s; s = getString(); int arr[10],a; for (int i=0; i< strlen(s); i++) { if(isdigit(s[i])) { a=(int)s[i]-'O'; arr[a]++; } } hash(arr); return 0; }
᳅𝙈𝙑𝙃𝙈𝙊𝘿
I know you😕
😌
can anyone get the key for this question???
Björn
Can someone help me with a code error please? I try to define a function from a class in a namespace and it says "Cannot be defined in curront scope" while I put the function as public?
Björn
I follow the code from a book and I always get errors LoL
😌
/* PROBLEM STATEMENT The DSC RIT team wanted to make a very complex question for the participants on the Bug Bounty Challenge. They tried very hard but their program for the competition still had some bugs. Now they want your help to implement the following logic: You are given a string with some alphabets(a-z or A-Z) and digits(0-9). Here are the sequence of steps we are doing 1. Calculating the FREQUENCY of each digit that appeared in the string. 2. The count of each digit is stored in an array. 3. That array is passed to a function called HASH and that prints a string. 4. The string printed is your KEY for the NEXT QUESTION. Fix any bugs in this code and the DSC RIT team will give you the KEY for you to continue your journey and win the Bug Bounty Contest! INSTRUCTIONS 1. The hash function is correct and doing its job, please DO NOT MODIFY IT 2. THE INPUT is already handled for you. 3. You are supposed to fix the logic for counting the frequency of characters correctly and fix the bugs present. INPUT: Already Handled, Please don't touch the HEADER FILES. OUTPUT: 1. The OUTPUT Printed on your console is key to enter into website. 2. The OUTPUT is of the format: XXXXXXXohw */ #include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <ctype.h> #include "helpers.h" int main() { char s; s = getString(); int arr[10],a; for (int i=0; i< strlen(s); i++) { if(isdigit(s[i])) { a=(int)s[i]-'O'; arr[a]++; } } hash(arr); return 0; }
?
Björn
Shall I dm or just put it here
Björn
Can I post it or I get warned?
Björn
"Database.cpp" namespace Records { Employee& Database::addEmployee(const string& firstName, const string& lastName) { Employee theEmployee(firstName, lastName); theEmployee.setEmployeeNumber(mNextEmployeeNumber++); theEmployee.hire(); mEmployees.push_back(theEmployee); return mEmployees[mEmployees.size() - 1]; }
Björn
"Database.h" class Database { public: Employee& addEmployee(const std::string& firstName, const std::string& lastName); Employee& getEmployee(int employeeNumber); Employee& getEmployee(const std::string& firstName, const std::string& lastName); void displayAll() const; void displayCurrent() const; void displayFormer() const; private: std::vector<Employee> mEmployees; int mNextEmployeeNumber = kFirstEmployeeNumber; };
Dima
nah its okay
Björn
But I get " error C2888: 'Employee &Database::addEmployee(const std::string &,const std::string &)': symbol cannot be defined within namespace 'Records'" though.
V01D
I believe you, but can I do it?
Lol, idk. Learning oop just now
Björn
/get cppbookguide
Björn
/get cppbookguide
Björn
Yes True that was it and it also fixed previous errors I had thanks :)
Björn
I closed the Records namespace infront of it but I had to put the class in
Mar!o
Do you think using a std::vector<std::tuple<string, MessageType>> is a bad idea as a logger? I need a custom logging system for a game and it should be isolated from cout (faster) and the MessageType indicates the type like {Error, Warning} etc... so the game can render them in different colors. I don't want to use ANSI color codes. To push a log I woud do: Logger.emplace_back(std::make_tuple(std::move(msg), MessageType::Info)) Also it would be easy to render this in the game and to flush it into a log file. Has anyone used/made a system like that before? What do you think?
Mar!o
That doesn’t seem to be data oriented
Yeah this was also my problem... I could also make one HUGE string and each message then is seperated by \n but then there is the color problem...
Mar!o
are you going to use mutex for several threads?
No it's only called from the main thread
Alex
No it's only called from the main thread
how are you going to log from other threads?
Mar!o
how are you going to log from other threads?
There is no real logging from other threads; logging is only done by the kernel which has subsystem interfaces, which are logging from various APIs which are internally multithreaded...
Mar!o
This is the ingame terminal - the good thing about the Vector approach is that its easy to render: Just iterate it and draw the text using ImGui. If the message type is an error/warning/... we just push a style color and it's done. But it does not fell right somehow :(
Mar!o
Have already done that... the good thing at least is that I move the strings into the vector and I also have a utlity function which shrinks_to_fit all strings. But I still would like a better solution...
Mar!o
But also in the end it's just logging and since I'm not logging every frame it should be fine I guess
Alex
add macro for Trace level
Alex
probably string rvalue is not the best option
Anonymous
Guys, can we learn C++ in a week?, is that possible?
Anonymous
Guys, can we learn C++ in a week?, is that possible?
only if you exclude concurrency, template metaprogramming, and best practices
Anonymous
also need to be familiar with stuff like exceptions from a different language
Asdew
only if you exclude concurrency, template metaprogramming, and best practices
That's a huge oversimplification. You can't learn C++ in a week.
Siddhant
Guys, can we learn C++ in a week?, is that possible?
Believe me if u do it in a week, you are doing it wrong 😅
Siddhant
Bio 😂
Asad
How about learning C in a week?
Asdew
No.
Vlad
You don't learn language you learn programming.
K
What's the issue with to_string, it's showing error could not find.
Asad
No.
How about a month? (I can code in C++ and C#)
Asdew
How about a month? (I can code in C++ and C#)
How well can you program in C++ and C#?
Dima
ewwww cli is terrible
Asad
You don't learn language you learn programming.
True. I want to learn the language well enough to be able to build relatively large projects...
Vlad
C++/CLI?)
Sorry for bringing that up :P
Asdew
CLI is better than GUI.
Vlad
CLI is better than GUI.
It's not THAT CLI, lmao.
Siddhant
How about a month? (I can code in C++ and C#)
Yes printf("hello world"),
Asdew
Oh, that CLI.
Asdew
Sorry, that CLI sucks.
Anonymous
How about learning C in a week?
same. if you just want to learn the language and the standard library, 1 week is enough. obviously some previous knowledge of manual memory management in a different language is needed.
Siddhant
Come on🙄
Char str[] = "hello" printf(%s,str) in one week 🙂
Siddhant
Come on🙄
R u russian?
Vlad
Also why these estimates? Are you gonna die in a week or a month. So you must learn C in that time period. It's silly.
Mar!o
consider overloading operator« instead of variadic template
It's not possible because the formatting requires variadic templates
Asdew
Char str[] = "hello" printf(%s,str) in one week 🙂
I prefer printf(text) where text is user-supplied text.
Mar!o
probably string rvalue is not the best option
Yeah I will change that to a const&
Vlad
"%s" coming at ya
Nice UB you got there