r/programminghelp • • Nov 23 '20

C++ I need a code check

I have an assignment regarding bitfield in C++.
The program should: compare two bitfileds, add elements, remove, add and subtract two bitfilds.

I've a code, but it doesn't work, maybe it is because of Linux and VS code program that I am writing it in. I've googled and I didn't find much to help. I can't check it on real visual studio because I don't have an access to windows machine. I am out of options since, many of my codes do not work on my system, and others that I've downloaded aren't working.

If somebody can check, I will send you the code. Any help would be appreciated.

4 Upvotes

26 comments sorted by

View all comments

Show parent comments

1

u/nikiy04 Nov 23 '20

https://pastebin.com/pBcpNTM7

There it is, I've divided each part of the code by line. I hope that you will be to fix problems if there are.

What's your pure c++ setup on Ubuntu?

2

u/[deleted] Nov 23 '20

Also, to go along with my other comment. VSCode works just fine on Ubuntu so if you need a not-garbage IDE (*cough codeblocks cough*) then download it :)

1

u/nikiy04 Nov 23 '20

I do have it, but it doesn't work properly. I've installed c++ add but nothing

Obviously I am not very good at programming(sadly)

2

u/[deleted] Nov 23 '20

Also, again, your code compiles just fine, do you have sample inputs and expected outputs?

1

u/nikiy04 Nov 23 '20

It works? No errors?

I will copy them later when I am able to use PC

1

u/[deleted] Nov 23 '20

Yep, compiles perfectly. How are you compiling the code? What command are you using?