Search
 
SCRIPT & CODE EXAMPLE
 

C

c programming language

Dinosaurs love it!
Comment

c language

#include <stdio.h>
#pragma warning (disable:4996)

struct address {
	char city;
	int cCode;
};

typedef struct {
	char mem_name[25];
	char mem_gender;
	char mem_mail;
	int mem_id;
	int mem_ic;
	int mem_num;
	struct address addr;
} member;

int main() {
	FILE* memptr;
	member mem;
	int x;
	memptr = fopen("Member Info.bin", "wb");
	if (!memptr) {
		printf("Unable to open the file, please try again");
	}
	else {
		printf("Enter your details: 
");
		for (x = 0; x < 20; x++) {
			printf("Name > ");
			rewind(stdin);
			scanf("%[^
]", mem.mem_name);

			printf("Gender (M = male, G = female) > ");
			rewind(stdin);
			scanf("%s", mem.mem_gender);

			printf("Member ID > ");
			rewind(stdin);
			scanf("%d", mem.mem_id);

			printf("NRIC (without -) > ");
			rewind(stdin);
			scanf("%d", mem.mem_ic);

			printf("Contact Number > ");
			rewind(stdin);
			scanf("%d", mem.mem_num);

			printf("Email > ");
			rewind(stdin);
			scanf("%[^
]", mem.mem_mail);

			printf("Address > ");
			printf("		 City Name > ");
			rewind(stdin);
			scanf("%s", mem.addr);
			printf("		 City Code > ");
			rewind(stdin);
			scanf("%d", mem.addr);

			fwrite(&mem, sizeof(member), 1, memptr);
		}
		fclose(memptr);
	}

	memptr = fopen("Member Info.bin", "rb");
	for (x = 0; x < 20; x++) {
		fread(&mem, sizeof(member), 1, memptr);
		printf("%s|%s|%d|%d|%d|%s|%s|%d
", mem.mem_name, mem.mem_gender, mem.mem_id, mem.mem_ic, mem.mem_num, mem.mem_mail, mem.addr, mem.addr);
	}
	fclose(memptr);
}
Comment

C language

#include <stdio.h>

int main() {
  printf("Hello, World!
");
}
Comment

c language

C programming language is the mother language of all programming language.
Comment

programming c

i can see you, go out of here!
Comment

c language

int can(int[] gas, int[] cost) {
        begin = 0
        sum = 0
        tank = 0
        for( i = 0 to i < gas.size() ) {
            tank = tank + gas[i] - cost[i]
            if(tank < 0) {
                begin = i+1
                sum= sum + tank
                tank=0
            }
        }
        if(sum + tank < 0) {
            return -1
        } else { 
            return start
        }
    }
Comment

PREVIOUS NEXT
Code Example
C :: equal string c 
C :: How to Convert double to int in C 
C :: houdini vex loop over points 
C :: signal function c 
C :: Passing a matrix in a function C 
C :: c program to find the frequency of characters in a string 
C :: How to pass a struct value to a pthread in c? 
C :: c in to str 
C :: print command for rust unit-test 
C :: link list c 
C :: delay in c programming for windows 
C :: int data types in c 
C :: malloc c 
C :: pygramid program in c 
C :: empiler une pile on c 
C :: how to insert elements in and array and print it in c 
C :: fread 
C :: stack and heap memorym in ram 
C :: while loop c 
C :: check for duplicates c 
C :: Install valet-linux 
C :: Symmetrical matrix in C 
C :: android studio sdkmanager always accept 
C :: String to Integer (atoi) 
C :: block quote in lua 
C :: BST or NOT ?? 
C :: VLOOKUP CHECK #N/A 
C :: man write c 
C :: list fiter octobercms 
C :: what the value in array not initialized yet c 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =