You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* TOASK:
* 1s. using id 410 works, but changing it to 010 will not print out 8 instead
* Similarly, 020 becomes 16
* How does it become octal?
*/
I have checked your implementation of the append_child function (its signature is: TreeNode * append_child(TreeNode * tree_node, int child_response_code, enum node_colour colour)). If you pass "010", C treats it as an octal number and hence its decimal value is 8. Similarly 020 -> 16, 030 -> 24 and so on. I think you just need to pass decimal numbers and it should be fine.
The text was updated successfully, but these errors were encountered:
Hi @alan32liu
Last week you asked the following question
/* TOASK:
* 1s. using id 410 works, but changing it to 010 will not print out 8 instead
* Similarly, 020 becomes 16
* How does it become octal?
*/
I have checked your implementation of the append_child function (its signature is: TreeNode * append_child(TreeNode * tree_node, int child_response_code, enum node_colour colour)). If you pass "010", C treats it as an octal number and hence its decimal value is 8. Similarly 020 -> 16, 030 -> 24 and so on. I think you just need to pass decimal numbers and it should be fine.
The text was updated successfully, but these errors were encountered: