Go开发工程师:迎接上升风口,踏入蓝海行业!【完结】dsgdag

184 阅读1分钟

download:Go开发工程师:迎接上升风口,踏入蓝海行业!【完结】

首先还是应该科普下函数参数传送机制,传值和传援用是什么意义?

先看一个简单的例子:

from ctypes import *
import os.path  
import sys
def test(c):
    print "test before "
    print id(c)
    c+=2
    print "test after +"
    print id(c)
    return c
def printIt(t):
    for i in range(len(t)):
        print t[i]
if __name__=="__main__":
    a=2
    print "main before invoke test"
    print id(a)
    n=test(a)
    print "main afterf invoke test"
    print a
    print id(a)