佚名通过本文主要向大家介绍了int怎么转换成string,int怎么读,int怎么用,excel int函数怎么用,int函数怎么用等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: swift char + int 怎么写?
描述:
解决方案1:
描述:
在oc中 char * 可以直接加上 int swift中改怎么写?
char * buf = (char *)malloc(_pFrame->width * _pFrame->height * 3 / 2);
int a = 0
buf + a
怎么用swift写 buf + a
?
解决方案1:
Swift 3.0 (2.x没有试过, 但是思路应该是一样的)
import Foundation
// alloc
let buff = UnsafeMutablePointer<CChar>.alloc(1)
// 赋值
buff.memory = CChar(integerLiteral: 8)
// 计算
print(buff.memory + 2)
// 销毁
buff.destroy()
// 释放
buff.dealloc(1)