Advertisement
math230

prep for union of 2 arrays

Sep 16th, 2015
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. //prep to copy two arrays of integers into one. (form a union)
  3. int main()
  4. {
  5.   int i=0;
  6.   int a[] = {1,2,3,4,5,6,7,8};
  7.   int b[] = {14,15,16};
  8.  
  9.   int M = sizof(a) / sizeof(int);
  10.   int N = sizof(b) / sizeof(int);
  11.  
  12.   int* c = malloc( (M+N)* sizeof(int) );  
  13.  
  14.   return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement