Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

hasani2007

@hasani2007
About
Posts
38
Topics
32
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • making a shop with c++
    H hasani2007

    Hello I should make a computer shop with c++ using classes. Please help me anyway you can.

    Managed C++/CLI c++ help

  • member function don't pass to class!!!???
    H hasani2007

    Hello all; I am writing a tiny phone book program using classes.

    using namespace std;
    class phonebook{
    public :
    void add_new();

      private :
              char \*name;
              char \*family;
      };
      void phonebook::add\_new(){
           phonebook \*temp=new phonebook;
           cin >> temp->name;
           cin >> temp->family;
      }
    

    int main(int argc, char *argv[])
    {
    phonebook::add_new();
    system("PAUSE");
    return EXIT_SUCCESS;
    }

    Any work I do; I can't get a name and family. my program should be dynamic. What should I do to get response? Thanks in advance...

    C / C++ / MFC question learning

  • two dimension pointers
    H hasani2007

    Hello I want to program a phone book using two dimension pointers. Please help me with a simple example of string two dimensional pointer. Thanks in advance

    Managed C++/CLI help tutorial learning

  • 10 & 10/3*3 are not equal ! ! ! WHY?
    H hasani2007

    Hello all and congratulate for new theme of site.

    float f1,f2;
    bool b;
    float f1 = 10.0;
    float f2 = f1 / 3;
    b = f1 == (f2 * 3.0);

    WHY always b is 0 (false). Really aren't f1 and f2 equal? If it is, why? THankS in AdVanCE. . .

    C / C++ / MFC question

  • change color in c
    H hasani2007

    Hello I want to change the color of text in c(win32 console). but not entire text only a piece of text that is in the middle. what can I do? best regards...

    C / C++ / MFC question

  • Can someone give a detail of this sample coder why the result is 9,and not 4??
    H hasani2007

    Hello It's not very hard. answer of this simple question is : YOU WRITE ++x TWICE.y=++x[first time]*++x[second time] don't forget to vote me. BYE...

    C / C++ / MFC question

  • How to find the correct coordinate?
    H hasani2007

    Hello all this is my maze. when the worm reach to wall it passes the wall and sometime it stops.

    #include <stdio.h>
    #include <conio.h>

    int dir=0;
    char wall[40][50]={
    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1},
    {1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,1},
    {1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,1,0,1},
    {1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1},
    {1,1,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,1,0,1},
    {1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1},
    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    };

    /* prototypes */
    create_wall();
    arrow_keys();
    /* end of prototypes */

    void main()
    {
    int a=3,b=2;
    create_wall();
    lbl : arrow_keys();
    if (dir==72){
    b-=1;
    if (wall[a][b]==0){wall[a][b]='*';gotoxy(a,b); printf("%c",wall[a][b]);goto lbl;}
    else b+=1;goto lbl;
    }
    if (dir==75){
    a-=1;
    if (wall[a][b]==0){wall[a][b]='*';gotoxy(a,b); printf("%c",wall[a][b]);goto lbl;}
    else a+=1;goto lbl;
    }
    if (dir==77){
    a+=1;
    if (wall[a][b]==0){wall[a][b]='*';gotoxy(a,b); printf("%c",wall[a][b]);goto lbl;}
    else a-=1;goto lbl;
    }
    if (dir==80){
    b+=1;
    if (wall[a][b]==0){wall[a][b]='*';gotoxy(a,b); printf("%c",wall[a][b]);goto lbl;}
    else b-=1;goto lbl;
    }
    if (dir==0) {printf("exit");}
    }

    /* function to create the walls */
    create_wall(){
    clrscr();
    int i,j;
    for(i=0;i<15;i++){
    for(j=0;j<26;j++){
    if (wall[i][j]==1) printf("²");
    else printf(" ");
    }
    printf("\n");
    }
    gotoxy(2,2);
    printf("**");
    }
    /* end of create_wall function */
    ////////////////////////////////////
    /* function to define arrow keys */
    int arrow_keys()
    {
    int ch;
    while(1)
    {
    ch=getch();
    if(ch==0)
    {
    ch=getch();
    if(ch==72) {dir=72; break;}
    if(ch==75) {dir=75; break;}
    if(ch==77) {dir=77; break;}
    if(ch==80) {dir=80; break;}
    }
    else dir=0;
    break;

      }
    

    }

    Wher

    C / C++ / MFC tutorial question

  • a problem in maze (the worm pass the walls)
    H hasani2007

    Hello Ash; I wrote these codes you say me. but it doesn't work correctly. It stop in another position that there is no wall and sometime it pass a wall and stop on the next one. These code are right, but I can't write them in its own place. Please help me by writing codes if it is possible for you.

    C / C++ / MFC help question

  • a problem in maze (the worm pass the walls)
    H hasani2007

    Hello all I am working on maze in turbo c(command prompt not windows). I write 90% of it. but there are 2 problems I do any work can't solve it. 1- When worm(** is my worm) reach a wall it don't stop. it can pass the wall? 2- the worm make longer but it should be ** in any time?

    #include <stdio.h>
    #include <conio.h>

    int dir=0;
    char wall[40][50]={
    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    {1,0,0,0,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1},
    {1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,1},
    {1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,1,0,1},
    {1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1},
    {1,1,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,1,0,1},
    {1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1},
    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    };

    /* prototypes */
    create_wall();
    arrow_keys();
    /* end of prototypes */

    void main()
    {
    int a=3,b=2;
    create_wall();
    lbl : arrow_keys();
    if (dir==72){b-=1; wall[a][b]='*';gotoxy(a,b); printf("%c",wall[a][b]);goto lbl;}
    if (dir==75){a-=1; wall[a][b]='*';gotoxy(a,b); printf("%c",wall[a][b]);goto lbl;}
    if (dir==77){a+=1; wall[a][b]='*';gotoxy(a,b); printf("%c",wall[a][b]);goto lbl;}
    if (dir==80){b+=1; wall[a][b]='*';gotoxy(a,b); printf("%c",wall[a][b]);goto lbl;}
    if (dir==0) {printf("exit");}
    }

    /* function to create the walls */
    create_wall(){
    clrscr();
    int i,j;
    for(i=0;i<15;i++){
    for(j=0;j<26;j++){
    if (wall[i][j]==1) printf("²");
    else printf(" ");
    }
    printf("\n");
    }
    gotoxy(2,2);
    printf("**");
    }
    /* end of create_wall function */
    ////////////////////////////////////
    /* function to define arrow keys */
    int arrow_keys()
    {
    int ch;
    while(1)
    {
    ch=getch();
    if(ch==0)
    {
    ch=getch();
    if(ch==72) {dir=72; break;}
    if(ch==75) {dir=75; break;}
    if(ch==77) {dir=77; break;}
    if(ch==80) {dir=80; break;}
    }
    else dir=0;
    break;

      }
    

    }

    Please help me to solve the problems. Thanks in advance

    C / C++ / MFC help question

  • move function in maze does not work correctly
    H hasani2007

    Hello It's a maze program,but is not completed. I want to define move function to move the ** (worm). when I ask the value of arrow_keys() it has no response(see move function) in other word move function doesn't work(it is not completed).

    #include <stdio.h>
    #include <conio.h>

    /* prototypes */
    create_wall();
    arrow_keys();
    move();
    /* end of prototypes */

    void main()
    {
    create_wall();
    arrow_keys();
    move();
    }

    /* function to create the walls */
    create_wall(){
    clrscr();
    int i,j;
    char wall[15][26]={
    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    {1,0,0,0,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1},
    {1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,1},
    {1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,0,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,1,0,1},
    {1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1},
    {1,1,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,1},
    {1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,1,0,1},
    {1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1},
    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    };
    for(i=0;i<15;i++){
    for(j=0;j<26;j++){
    if (wall[i][j]==1) printf("²");
    else printf(" ");
    }
    printf("\n");
    }
    gotoxy(2,2);
    printf("*");
    gotoxy(3,2);
    printf("*");

    }

    /* end of create_wall function */
    ////////////////////////////////////
    /* function to define arrow keys */
    int arrow_keys()
    {
    int ch;
    while(1)
    {
    ch=getch();
    if(ch==0)
    {
    ch=getch();
    if(ch==72) return 72;
    if(ch==75) return 75;
    if(ch==77) return 77;
    if(ch==80) return 80;
    }
    else break;
    }
    }

    /* function for move */
    // up=72 , down=80 , left=75 , right=77
    move(){

    if (arrow_keys()==75)
    {
    clrscr();
    printf("bvccvbncvnvbnvb");
    }
    }

    C / C++ / MFC

  • maze in c
    H hasani2007

    Hello all I want to programa maze in c. Does anyone have a paper about it. Thanks in advance.

    C / C++ / MFC

  • multiplication of two arrays
    H hasani2007

    It's last time I do this work. If you can & if you know anything about it please help me. :( :doh: I request benediction for you from God. HELP ME>>>I AM IN PRESSURE>>>HELP ME

    C / C++ / MFC data-structures help tutorial

  • multiplication of two arrays
    H hasani2007

    Hello. I am confuse. Because of some snippet codes that any work I do can't solve them.(2-dimension arrays. like n[][]) 1-a program to get countries and then print the capital of them. Please give me an example. 2-multiplication of two arrays.(like x[m][n]*y[n][k]). 3- a code to get name and some grades of some students and then print them.(like other it should use dimensional array) I know it is not accorded to agreement of this site. but I AM CONSTRAINED. I promise to compensate it. If you can help me please don't withhold. THANK A LOT.

    C / C++ / MFC data-structures help tutorial

  • simple char array
    H hasani2007

    What should I do? Can you help me on this method...

    C / C++ / MFC data-structures

  • simple char array
    H hasani2007

    Hello all. I am programming a simple program in win32 console. #include <stdio.h> #include <conio.h> main() { int i,j; char list[80][20]; for(j=0;j<5;j++) { for(i=0;i<50;i++) { list[i][j]=getchar(); if (list[i][j]=='\n') break; } } for(j=0;j<5;j++) { for(i=0;i<50;i++) { putchar(list[i][j]); } } } It should give some char and then print them. but when it want to print some other things (&%^&*vjc) print.

    C / C++ / MFC data-structures

  • array with both string & float columns
    H hasani2007

    Hello all. I want to define an array in c win32 console. First column should be name & family of students and other columns should be grades of them. NOW HELP ME : How can I have this array with first string column and other columns in float. Thanks in advance.

    C / C++ / MFC data-structures help question

  • button + in calc works bad.
    H hasani2007

    Hello all; I have a question for my calculator project. command13 is a + button. when you sum 2 number it works correctly. but if you press this button for second time it will sum the last result with itself & again & again if you press + button. NOW HELP ME : what should I do to avoid sum in 2nd,3rd,... button click? snippet code is appended. Private Sub Command13_Click() Combo1.AddItem Combo1.Text Combo1.AddItem "+" 'b = Combo1.ListCount Select Case o Case Is = 1 Combo1.Text = a + Val(Combo1.Text) Case Is = 2 Combo1.Text = a - Val(Combo1.Text) Case Is = 3 Combo1.Text = a * Val(Combo1.Text) Case Is = 4 Combo1.Text = a / Val(Combo1.Text) End Select a = Val(Combo1.Text) h = 1 o = 1 End Sub Thanks anyone help me...

    Visual Basic question help

  • some header files doesn't work in visual studio 2008
    H hasani2007

    Hello I am using win32 console in visual stdio 2008, but conio.h and graphics.h and ... header files doesn't work. WHAT SHOULD I DO? Is there any way to make visual studio 2008 compatible with these header files? Thanks any one help me.

    C / C++ / MFC csharp visual-studio graphics help question

  • make a timer
    H hasani2007

    Hello I want to make a timer in maze.The timer should countdown to reach 0 and if the player doesn't reach to end he/she lose the game. I want to denote that if player reach to end timer should stopped working. How can I do it? Thanks anyone help me.

    C / C++ / MFC question game-dev help

  • recursive function
    H hasani2007

    I am dealing with a simple program in c(win32 console). the program should be able to print first n sentences of y=1-x+x^2/2-x^3/6+...+(-1)^n(x)^n/n! but I can't do it because I should program with recursive function. IS THERE A FRIEND HELP ME...

    C / C++ / MFC help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups