I just realized I posted this in the Programming mission section.



#include "stdafx.h"
#include "iostream"
#include <windows.h>
#include <string>
using namespace std;
int i = 1;
string shiftkey()
{
if (GetAsyncKeyState(VK_SHIFT) & 0x8000)
{
for(int a = 0; a < 1; a++)
{
string str3("it works!");
}
}
return str3;
}
int main()
{
cin.get();
return 0;
}

char *str = "this is a string literal";
#include <string>
int main() {
std::string s = "i am another string literal";
}

chrisx16x2008 wrote:I tried google before this post. maybe this would help more...
- Code: Select all
#include "stdafx.h"
#include "iostream"
#include <windows.h>
#include <string>
using namespace std;
int i = 1;
string shiftkey()
{
if (GetAsyncKeyState(VK_SHIFT) & 0x8000)
{
for(int a = 0; a < 1; a++)
{
string str3("it works!");
}
}
return str3;
}
int main()
{
cin.get();
return 0;
}
this is my code and i keep getting an 'str3' undeclared identifier error
Also I know there is some stuff I don't need in there like int i = 1. That is just some stuff I used for some code i deleted from it.


Users browsing this forum: No registered users and 0 guests