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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. a wrong about EMS

a wrong about EMS

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    youbo
    wrote on last edited by
    #1

    when I run the code,it says a wrong about EMS,please help #include using namespace std; void two(int k) { int x,i=1,n; int p1[100],p2[100]; while(i) { i=k/2; x=k%2; k=i; p1[n]=x; n++; } cout<0;n--,a++) { p2[a]=p1[n-1]; //cout<>a; two(a); }

    _ 1 Reply Last reply
    0
    • Y youbo

      when I run the code,it says a wrong about EMS,please help #include using namespace std; void two(int k) { int x,i=1,n; int p1[100],p2[100]; while(i) { i=k/2; x=k%2; k=i; p1[n]=x; n++; } cout<0;n--,a++) { p2[a]=p1[n-1]; //cout<>a; two(a); }

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      First of all you don't initialize the variable 'n' in your code. so p1[n] is an invalid location. When you try and store a value at that place it would be throwing an error or possibly a crash. Can you just check if this is the root cause?

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      Y 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        First of all you don't initialize the variable 'n' in your code. so p1[n] is an invalid location. When you try and store a value at that place it would be throwing an error or possibly a crash. Can you just check if this is the root cause?

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        Y Offline
        Y Offline
        youbo
        wrote on last edited by
        #3

        thank you .i have find it .a little mistake led on to a great error.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

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