Skip to content
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

C CPP template #23

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

ismagilli
Copy link

@ismagilli ismagilli commented Jul 12, 2024

I have implemented C and CPP templates for this challenge.

Note for C template. I have checked all currently existing tests and have found that longest input file thru all 57 tests has length 176. Thus 1000 should be enough for the length of the array.

@ismagilli ismagilli force-pushed the c_cpp_template branch 2 times, most recently from 6119056 to 3c8678c Compare July 12, 2024 23:38
@ismagilli
Copy link
Author

ismagilli commented Jul 12, 2024

Small fixes thru force pushed commits:

  • Few typos was fixed in solutions/cpp/01-ry8/explanation.md (app/main.c -> src/main.cpp and c -> cpp)
  • codecrafers.yml was added to C template
  • Trailing empty lines were added to all files
  • Segmentation fault was fixed in C example ( = { 0 } was added)
  • String variables were renamed (input -> file_contents)
  • Code for reading from file was changed in CPP template
  • Tiny typo was fixed (std:cerr -> std::cerr inside comments) in CPP template
  • INPUT_BUF_LEN was removed from C template (hardcoded constant 1000 was used like 100 was hardcoded in "Build Your Own Shell" challenge)

@ismagilli ismagilli force-pushed the c_cpp_template branch 3 times, most recently from bed3a41 to a009d48 Compare July 17, 2024 17:15
@rohitpaulk
Copy link
Member

Thank you for the PR! Will take a look this week once we've worked on adding course-sdk add-language support to C & C++. That'll make it easier to ensure things are consistent across all challenges (removes a lot of the rote work of copying dockerfiles etc.)

@ismagilli
Copy link
Author

@rohitpaulk I've fixed my code but haven't push updates since I was waiting for your reply to my email. Here is the fixed code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants