【发布时间】:2014-01-31 04:39:31
【问题描述】:
我正在尝试在 Xcode 5 上编译这个简单的程序,并且在下面的错误行中收到“线程 1:断点 1.1”消息。有人知道我该如何解决吗?
这是我的代码:
#import <Foundation/Foundation.h>
int totalSavings(int listTotal);
int main(int argc, const char * argv[])
{
@autoreleasepool {
int itemEntry, itemEntry1, itemEntry2,
listTotal, calcSavings;
itemEntry = 320;
itemEntry1 = 218;
itemEntry2 = 59;
listTotal = itemEntry + itemEntry1 + itemEntry2;
calcSavings = totalSavings(listTotal); \\error line
NSLog(@"Total Planned Spending: %d \n Amount Saved: %d", listTotal,
calcSavings);
}
return 0;
}
int totalSavings(int listTotal)
{
int savingsTotal;
savingsTotal = 700 - listTotal;
return savingsTotal;
}
【问题讨论】:
-
从导致错误的行中删除
int。 -
建议:找一本关于“C”语言的好书学习一下——我就是这么做的。
标签: objective-c xcode expression