⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 callingocfromlabtalkex.c

📁 图像处理的压缩算法
💻 C
字号:
/*------------------------------------------------------------------------------*
 * File Name: CallingOCFromLabTalkEx.c											*
 * Creation: BT & GJL 8/25/03													*
 * Purpose: OriginC Source C file containing CallingOCFromLabTalkEx.c examples.	*
 * Copyright (c) OriginLab Corp.	2003										*
 * All Rights Reserved															*
 *------------------------------------------------------------------------------*/

#include <Origin.h>

// Casting of Arguments
void PrintNumeric(int ii)
{
	printf("The number is %d", ii);
}

// Operating on Scalors and Vectors
double CallOnceForeachElement(double a, double b)
{
	return a + b;
}

// Passing Strings with and without Substitution 
void PassString(string str)
{
	printf("The string is \"%s\"\n", str);
}

// Passing Vectors by Reference
vector PassVectorByReference(vector& vIn, double f)
{
	return (vIn * f);
}

// Passing an Array of Strings
vector PassArrayOfStrings(vector<string> vIn)
{
	vector vOut(vIn.GetSize());
	for(int ii = 0; ii < vIn.GetSize(); ii++)
		vOut[ii] = vIn[ii].GetLength();        
	return vOut;
}

// Returning a String
string GetErrorMessage(int iErrorCode)
{
	string str;
	str.Format("Error message %d", iErrorCode);
	return str;
}

// Returning a Vector
vector ReturnAVector(double f)
{
	vector vData = {0, 1, 2, 3, 4};
	return (vData * f);
}

void tt()
{
	vector vv(5);
	vv = ReturnAVector(12);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -