Need help With errors

Posts 1–15 of 16 · Page 1 of 2
Need help With errors
My Program:
Code:
/*
*** COMPILING WITH DEV C++ 4.9.9.2 ***
*/

#include <windows.h> 
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

using namespace std;

int main(int argc, char *argv[])
{
    
    
  if (GetAsyncKeyState(VK_LSHIFT)&1) {
		do {
			int a;
    string array [42] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9", " ", " ","?","!","#","*" };
    
    {
   Sleep(45);  
    for(int i=0; i<27; i++)
             {
             a = rand()%42;
             cout << "\n " << array[a];
             cout << " ";
             }
             cout << endl;
    }
    getch();
    return 0;
    	
  } 
  else (GetAsyncKeyState(VK_RSHIFT)&1) 
  {
		do {
			 int b;
			string array [1] = {"WRONG CHOICE..."};
    {
   Sleep(45);  
    for(int i=0; i<27; i++)
             {
             b = rand()%1;
             cout << "\n " << array[b];
             cout << " ";
             }
             cout << endl;
    }
    getch();
    return 0;
}
}
}
}
I'm using Dev-C++ and am constantly getting errors, I'm not sure why though..

The purpose of this program is if int a is called, it shows the random integers, and it will look like the matrix (that's when the LShift is pressed) and when the RShift is pressed, it's supposed to show the else choice.

Thanks to all who can help me
-Money001
It might be me being stup because I use VC++. But I don't think you can include windows.h in Dev-C++. But again, I never use Dev-C++.

(I btw didn't look at the rest of your code)
Quote Originally Posted by Nathan View Post
It might be me being stup because I use VC++. But I don't think you can include windows.h in Dev-C++. But again, I never use Dev-C++.

(I btw didn't look at the rest of your code)
You call it on Dev also.. This post doesn't help me much unfortunatly.
Using a string array when a char array would suffice... and C-style includes.
It'd help to see the errors. lol
put the code into there, and look at the errors yourself, It's not super hard =/....
Quote Originally Posted by money001 View Post
put the code into there, and look at the errors yourself, It's not super hard =/....
I am lost, you're talking to yourself?
Quote Originally Posted by money001 View Post
put the code into there, and look at the errors yourself, It's not super hard =/....
Sorry for attempting to help someone at work. and secondly i am not taking the time to install what IDE he is using. he posted the code i do not see why he could not post the errors.
If you want help you should post the errors. We are not people who get paid to answer questions, so don't ever ask us to compile to get the errors. It is very rude. If you don't post the info needed we simply won't help you.

I don't mean to be harsh, and don't think that I don't like you because that is not the case. This is a very helpful C++ community, and I wanted to advise you on how to get an answer for your question.
Thanks in advance.
Quote Originally Posted by money001 View Post
put the code into there, and look at the errors yourself, It's not super hard =/....
Wait a sec, where you the one asking for help or have we someone become the ones asking for help on your behalf towards ourselves?
I think the guy is trying to be ironic.
Replying to hes own posts, /haha.
Post the Compiler Errors

Also, if i were you, I would get visual C++ 2008 express. It's free, and it is better. When I tried Dev, i got many errors not regarding code, but something with the .o files or something like that.
Everyone who even thinks he 'knows' Cpp should have seen this even without errors & whutnot:

Code:
  }   else (GetAsyncKeyState(VK_RSHIFT)&1) // this should either be else if or just another if statement. What you're doing now makes no sense.
Posts 1–15 of 16 · Page 1 of 2

Post a Reply

Tags for this Thread

None

Talk with us