C_ÆÕͨλÔËËã
Ô´Âë:
# include <stdio.h>
int main()
{
/* ¶¨ÒåÁËÒ»¸öÎÞ·ûºÅ×Ö·ûÐͱäÁ¿£¬´Ë±äÁ¿Ö»ÄÜÓÃÀ´´æ´¢ÎÞ·ûºÅÊý */
unsigned char result;
int a, b, c, d;
a = 2;
b = 4;
c = 6;
d = 8;
/* ¶Ô±äÁ¿½øÐГ°´Î»Ó딲Ù×÷ */
result = a & c;
printf("result = %d\n", result);
/* ¶Ô±äÁ¿½øÐГ°´Î»»ò”²Ù×÷ */
result = b | d;
printf("result = %d\n", result);
/* ¶Ô±äÁ¿½øÐГ°´Î»Òì»ò”²Ù×÷ */
result = a ^ d;
printf("result = %d\n", result);
/* ¶Ô±äÁ¿½øÐГȡ·´”²Ù×÷ */
result = ~a;
printf("result = %d\n", result);
return 0;
}
Ïà¹ØÎĵµ£º
ÏÂÃæÕâ¸ö³ÌÐòÊä³öʲô£¿
enum {false,true};
int main()
{
int i=1;
do
{
printf("%d\n",i);
i++;
if(i < 15)
continue;
}while(false);
return 0;
}
ÄãÏàÐÅô£¿Ï ......
VCÖÐÏÂÃ漸¸ö½á¹¹Ìå´óС·Ö±ðÊǶàÉÙÄØ
struct MyStruct
{
double m4;
char m1;
int m3£»
};
s ......
ÓÃÒ»¾ä»°¸ÅÀ¨extern “C”Õâ¸öÉùÃ÷µÄÕæʵĿµÄ¾ÍÊÇʵÏÖC++ÓëC¼°ÆäËüÓïÑԵĻìºÏ±à³Ì¡£
extern "C"µÄ¹ßÓ÷¨
£¨1£©ÔÚC++ÖÐÒýÓÃCÓïÑÔÖеĺ¯ÊýºÍ±äÁ¿£¬ÔÚ°üº¬CÓïÑÔÍ·Îļþ£¨¼ÙÉèΪcExample.h£©Ê±£¬Ðè½øÐÐÏÂÁд¦Àí£º
extern "C"
{
££i nclude "cExample.h"
}
¶øÔÚCÓïÑÔµÄÍ·ÎļþÖУ¬¶ÔÆäÍⲿº¯ÊýÖ»ÄÜÖ¸¶¨ÎªexternÀà ......
#include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uint date;
uchar mm=0,n=0;
uint k1,k2,k3,k4,k5,k6;
uchar code b[]={
0x3f,0x06,0x5b,0x4f,0x66, //0,1,2,3,4,
0x6d,0x7d,0x07,0x7 ......
#include <stdio.h>
#define MAX 100
int a[MAX], b[MAX], count = 0;
void rData()
{ int i;
FILE *fp;
fp = fopen("C:\\100.dat", "r");
for (i=0; i<MAX; i++)
fscanf(fp, "%d,", &a[i]);
fclose(fp);
}
void main()
{ int i;
rData();
//printf("Âú×ãÌõ¼þµÄÊý= ......