ʹÓÃmex CÉú³ÉMATLABµÄ¹ÉƱÊý¾Ý·ÖÎö½Ó¿Ú
#include "mex.h"
#define DWORD long
#define NUMBER_OF_STRUCTS (sizeof(friends)/sizeof(struct phonebook))
#define NUMBER_OF_FIELDS (sizeof(field_names)/sizeof(*field_names))
void mexFunction(int nlhs,
mxArray * plhs[] , int nrhs,const mxArray * pahs[])
{
typedef struct {
DWORD dt; //ÈÕÆÚ: ±ÈÈç¶Á³öÊý¾ÝΪ20031110,´ú±í2003Äê11ÔÂ10ºÅ
DWORD k_price;//¿ªÅ̼Û*0.01£¨£©:¶Á³öµÄ¼Û¸ñ³Ë0.01Ϊʵ¼Ê¼Û¸ñ¡£ÏÂͬ¡£
DWORD h_price;//×î¸ß¼Û*0.01
DWORD l_price;//×îµ×¼Û*0.01
DWORD s_price;//ÊÕÅ̼Û
float s_tolmoney;//(µ¥Î»:ÒÚ)
DWORD bur_tol;//³É½»Á¿
DWORD unknown; ///ûÓÐʹÓÃ
}ST_K_DATE;
FILE * f = 0;
int nfieldidx= 0;
char * pkdata;
int lday = 8;
int dims[2] = {1, lday };
char msg[128] = "";
char path[512] = {0};
int i,r,c ,*val;
double *kp,*sp,*hp,*lp,*tm,*vol;
int lseekpos;
mxArray *field_value;
const char *field_names[] = {"ÈÕÆÚ", "¿ªÅ̼Û","×î¸ß¼Û","×îµÍ¼Û","ÊÕÅ̼Û","³É½»½ð¶î","³É½»Á¿"};
ST_K_DATE * pd = 0;
r = mxGetM(pahs[0]);
c = mxGetN(pahs[0]);
sprintf(msg,"r:%d , c:%d rn",r,c);
mexPrintf(msg);
mxGetString(pahs[0],msg,128);
sprintf(path,"D:\jcb_hxzq\vipdoc\sh\lday\sh%s.day",msg);
me
Ïà¹ØÎĵµ£º
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸е쬻î»î»î£¡
&n ......
ÄÚ´æ¿ØÖÆÆª
calloc
free
getpagesize
malloc
mmap
munmap
calloc£¨ÅäÖÃÄÚ´æ¿Õ¼ä£©
Ïà¹Øº¯Êý
malloc£¬free£¬realloc£¬brk
±íÍ·Îļþ
#include <stdlib.h>
¶¨Ò庯Êý
void *calloc(size_t nmemb£¬size_t size);
º¯Êý˵Ã÷
calloc()ÓÃÀ´ÅäÖÃnmemb¸öÏàÁÚµÄÄڴ浥λ£¬Ã¿Ò»µ¥Î»µÄ´óСΪsize£¬²¢·µ»ØÖ¸ÏòµÚ ......
LinuxÏÂCºÍC++¿ª·¢»ù´¡
»ù±¾±à³Ì¸ÅÄî
n ±à³ÌÓïÑÔ£ºC ¡¢C++
n ±àÒë(compile)£ºÔ´Îļþ£¨.c£©->Ä¿±êÎļþ(.o)
n Á¬½Ó(link)£ºÄ¿±êÎļþ(.o)->¿ÉÖ´ÐÐÎļþ
n ¿â(library)£º¾²Ì¬Á¬½Ó¿â(.a)¡¢¶¯Ì¬Á¬½Ó¿â(.so)
LinuxÏ¿ª·¢¹¤¾ß
n±à¼Æ÷£ºvi¡¢emacs¡¢´°¿Ú±à¼Æ÷
n±àÒëÆ÷£ºGCC
nµ÷ÊÔÆ÷£ºGDB
n¿ÉÖ´ÐÐÎļþ¹¤¾ß£ ......
/*±àд³ÌÐò£¬ÊäÈë2¸öÊýÒÔ¼°¼Ó¼õ³Ë³ýÖеÄijÔËËã·ûºÅ£¬²¢µ÷ÓÃ×Ô¼º±àдµÄº¯Êý¼ÆËãÏàÓ¦µÄ½á¹û*/
#include<stdio.h>
#include<conio.h>
float cal(int a,char sym,int b);
main()
{
int a=0,b=0;
char sym='\0';
float c=0.0;
scanf("%d%c%d",&a,&sym,&b);
c=c ......
¶¨ÒåÒ»¸ö×Ö·ûÖ¸Õ룬Æä±¾ÖʵĴ¦Àí·½Ê½Êǰ´×Ö·ûÊý×é´¦ÀíµÄ£¬ÔÚÄڴ濪±ÙÒ»¸ö×Ö·ûÊý×éÓÃÀ´´æ·Å×Ö·û´®³£Á¿£¬ÕâÑù±Ø¶¨»áÖÕÖ¹·û¡£¶øÕâÑùµÄÌØÐÔÒ²½ö¶ÔÓÚ×Ö·ûÖ¸Õë±äÁ¿¡£
ÔÚCÓïÑÔÖУ¬Í¨¹ýÊý×éÃû»òÕßÖ¸Õë±äÁ¿Êä³öÒ»¸ö×Ö·û´®£¬ÎÒÀí½âΪÁ½¸ö£º×Ö·û´®ÖÕÖ¹·ûµÄ´æÔÚ£»ÒÔ%s¸ñʽµÄÊä³ö·½Ê½¡£
char *p="I love china!";
& ......