Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //otro ejemplo de vectores con punteros
- // mayo 2021
- #include "stdio.h"
- void pide(int *vector);
- void imprime(int *vector);
- int main(){
- int vector[10];
- pide(vector);
- imprime(vector);
- }
- void pide(int *vector){
- for (int i = 0;i < 10; ++i)
- {
- /* code */
- printf("Dime un numero del 1 al 6:");
- scanf("%i",(vector+i));
- }
- }
- void imprime(int *vector){
- for (int i = 0; i < 10; ++i)
- {
- /* code */
- printf("\n%i:%i",i+1,*(vector+i) );
- if (*(vector+i)==1){
- printf("Uno");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement