elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación C/C++ (Moderadores: Eternal Idol, Littlehorse, K-YreX)
| | |-+  paso de parametros a la funcion main y archvos pbm
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: paso de parametros a la funcion main y archvos pbm  (Leído 5,289 veces)
kikian94

Desconectado Desconectado

Mensajes: 66


Ver Perfil
Re: paso de parametros a la funcion main y archvos pbm
« Respuesta #10 en: 24 Noviembre 2013, 18:26 pm »

esto es lo que llevo pero no consigo hacerlo funcionar
Código
  1. #include<stdio.h>
  2.  
  3. #define FILA 121
  4. #define COLUMNA 180
  5.  
  6. int main(int argc,char *argv[]){
  7.  
  8. char cero [FILA][COLUMNA];
  9. int i,j;
  10.  
  11. char uno [FILA][COLUMNA];
  12. int x,y;
  13.  
  14.  
  15. int z=0;
  16. int bit;
  17.  
  18. //Patron del bit 0
  19. for(i=0;i<115;i++)
  20. for(j=0;j<COLUMNA;j++)
  21. cero[i][j]='0';
  22. for(i=115;i<118;i++)
  23. for(j=0;j<COLUMNA;j++)
  24. cero[i][j]='1';
  25. for(i=118;i<FILA;i++)
  26. for(j=0;j<COLUMNA;j++)
  27. cero[i][j]='0';
  28.  
  29. //Patron del bit 1
  30.  
  31. for(x=0;x<115;x++)
  32. for(y=0;y<COLUMNA;y++)
  33. cero[x][y]='0';
  34. for(x=115;x<118;x++)
  35. for(y=0;y<COLUMNA;y++)
  36. cero[x][y]='1';
  37. for(x=118;x<FILA;x++)
  38. for(y=0;y<COLUMNA;y++)
  39. cero[x][y]='0';
  40.  
  41. if(argc>1){
  42. printf("ejecute de nuevo el programa");
  43. }else{
  44.  
  45.  
  46. while(argv[1][z]=='1' && argv[1][z]=='0'){
  47. if(argv[1][z]=='1'){
  48. for(x=0;x<115;x++)
  49. for(y=0+bit;y<COLUMNA+bit;y++)
  50. printf("%c ",cero[x][y]);
  51. for(x=115;x<118;x++)
  52. for(y=0+bit;y<COLUMNA+bit;y++)
  53. printf("%c ",cero[x][y]);
  54. for(x=118;x<FILA;x++)
  55. for(y=0+bit;y<COLUMNA+bit;y++)
  56. printf("%c ",cero[x][y]);
  57. }
  58. if(argv[1][z]=='0'){
  59. for(i=0;i<115;i++)
  60. for(j=0+bit;j<COLUMNA+bit;j++)
  61. printf("%c ",uno[i][j]);
  62. for(i=115;i<118;i++)
  63. for(j=0+bit;j<COLUMNA+bit;j++)
  64. printf("%c ",uno[i][j]);
  65. for(i=118;i<FILA;i++)
  66. for(j=0+bit;j<COLUMNA+bit;j++)
  67. printf("%c ",uno[i][j]);
  68. }
  69.  
  70. bit=bit+COLUMNA;
  71. z++;
  72. }
  73.  
  74.  
  75.  
  76. }
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. return 0;
  85. }
  86.  


En línea

Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines