Advertisement
Aminpro

[ECP 1016]Tutorial 9 Question 9

Aug 26th, 2012
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. //https://www.facebook.com/AminproPastebin
  2.  
  3. #include <stdio.h> //1 header missing
  4.  
  5. void print (char *v); //2 prototype missing
  6.  
  7. int main(){
  8.  
  9.  
  10.  
  11.     int *pointer1, data, *pointer2 = &data;
  12.     char input1[7] = {‘H’,’E’,’L’,’L’,’O’,’\0};
  13.     char input2[7];
  14.     char *pointer3;
  15.     // pointers addition/subtraction removed(not possible)
  16.     print(input1);// no need & when passing whole array
  17.     printf(“ Please enter your name: \n”);
  18.     scanf(%s”,input2);// Array not need & sign
  19.     pointer3 = input2;
  20.     printf(pointer3);
  21.     return 0; //3 return missing
  22.     }
  23.  
  24.     void print(char *v){
  25.     printf(%s”,v); //4 s wrong
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement