我正在尝试将一些c代码导入到我的c ++程序中.有三行不直接导入:
首先:
free(t);
Run Code Online (Sandbox Code Playgroud)
第二:
new_node = (Tree *) malloc (sizeof (Tree));
Run Code Online (Sandbox Code Playgroud)
第三:
Tree * delete(int value, Tree * t)
Run Code Online (Sandbox Code Playgroud)
如何将这些更改为在C++中工作?
我正在尝试编写一个简短的代码来计算出由于每日兴趣而达到银行中给定本金所需的天数.使用我的代码在IDLE中运行时不会产生任何错误,但计数器返回0.任何想法我错过了什么?
def main():
# irrelevant code elided by msw, Bal, Int and Tar are numeric
counter = 0
for i in range(0):
if (Bal * Int) == Tar:
print '1'
else:
counter + 1
print counter
Run Code Online (Sandbox Code Playgroud)