🌈 style:

This commit is contained in:
lzy
2024-05-26 15:39:14 +08:00
parent 6f28a3384a
commit a57bbdb4c1
156 changed files with 765 additions and 770 deletions

View File

@@ -6,12 +6,12 @@
// a[i]value: a[i] = *(a+i) = *(p+i) = p[i]
// &a[i]: &a[i] = a+i = p+i = &p[i]
int main()
int main( )
{
int a[] = {5, 1, 7, 2, 8, 3};
int y;
int *p = &a[1];
int* p = &a[1];
y = (*--p)++;

View File

@@ -2,10 +2,10 @@
#include <stdlib.h>
#include <string.h>
int main()
int main( )
{
char *str = "hello";
char* str = "hello";
printf("%d %d\n", sizeof(str), strlen(str));
// out: 8 5

View File

@@ -18,12 +18,12 @@
#define PI 3.14
int main()
int main( )
{
int i = 1;
int j = 100;
const int *const p = &i;
const int* const p = &i;
//(F) p = &j;

View File

@@ -3,11 +3,11 @@
int main()
int main( )
{
int a[2][3] = {1, 2, 3, 4, 5, 6};
int i, j;
int *p = *a;
int* p = *a;
int(*q)[3] = a;

View File

@@ -3,16 +3,16 @@
int main()
int main( )
{
int i = 1;
int *p = &i;
int* p = &i;
// 相当于
// int *p;
// p = &i;
int **q = &p;
int** q = &p;
printf("i = %d\n", i);
printf("&i = %d\n", &i);

View File

@@ -1,9 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
int main()
int main( )
{
int *p;
int* p;
*p = 1;

View File

@@ -3,12 +3,12 @@
#include <string.h>
int main()
int main( )
{
char *name[5] = {"Follow me", "Basic", "Great", "Fortran", "Computer"};
char* name[5] = {"Follow me", "Basic", "Great", "Fortran", "Computer"};
// 指针数组
int i, j, k;
char *tmp;
char* tmp;
for (i = 0; i < 5 - 1; i++)
{