つい %c とするものかと思ったのですが。
NSString *str;
str = [[NSString alloc] initWithFormat:@"%d/%d/%02d", 2010, 12, 21];
NSLog(@"date format: %@", str); //NSStringをフォーマット出力する際は %@ を利用。オブジェクトそのものを出力
//NSLog(str);
NSString *str;
str = [[NSString alloc] initWithFormat:@"%d/%d/%02d", 2010, 12, 21];
NSLog(@"date format: %@", str); //NSStringをフォーマット出力する際は %@ を利用。オブジェクトそのものを出力
//NSLog(str);
#importint main (int argc, const char * argv[]) { int abc = 3; { int abc = 2; NSLog(@"%d", abc); // 2 } NSLog(@"%d", abc); // 3 return 0; }
$ nohup ./example.sh
<pre class="prettyprint"> (コード) </pre>
| 型 | 32bit環境 | 64bit環境 |
|---|---|---|
| short | 16 | 16 |
| int | 32 | 32 |
| long | 32 | 64 |
#import <Foundation/Foundation.h>
//マクロ定義
#define TEST 18 //プリプロセッサへの命令なので;(セミコロン)が必要ない。セミコロンを付けるとそれも展開される
int main (int argc, const char * argv[]) {
double test = 99; //ステートメント
NSLog(@"test : %d", test); //ステートメント
NSLog(@"TEST : %d", TEST); //ステートメント
return 0;
}
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
int num1 = 14;
int num2 = 4;
NSLog(@"num1 + num2 = %d", num1 + num2);
NSLog(@"num1 - num2 = %d", num1 - num2);
NSLog(@"num1 * num2 = %d", num1 * num2);
NSLog(@"num1 / num2 = %d", num1 / num2);
NSLog(@"num1 %% num2 = %d", num1 % num2);
return 0;
}
@"hoge"
$ open -h NSString
$ open hoge.txt
#import <Foundation/Foundation.h> #import <AppKit/AppKit.h> #import <CoreData/CoreData.h>
# -*- coding: utf-8 -*-
#global変数
hoge = "hoge"
def func1():
return hoge + " return by func1"
def func2(value):
#ここではローカルで hoge が利用される可能性があるので、
#hogeはローカル変数として割り当てられている
if value == 3:
hoge = "value is 3"
return hoge
print func1() #成功
print func2(3) #成功
print func2(2) #hoge がなくて、失敗
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
.bashrc へ以下の一行を追加
SVN_EDITOR='vim -c "set fenc=utf-8"'
最下部の表記を参考にしました
http://www.toshiki.net/x/modules/wordpress/index.php?cat=15