Skip to main content
Post Closed as "exact duplicate" by Loki Astari, Brian R. Bondy, David Thornley, Greg Hewgill
formatting, again
Source Link
Greg Hewgill
  • 1.0m
  • 192
  • 1.2k
  • 1.3k

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62";
int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; 

}

int main() { string bar = "0x00EB0C62"; int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; } 

So the output should be 0x00EB0C62.

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62";
int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; 

}

So the output should be 0x00EB0C62.

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62"; int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; } 

So the output should be 0x00EB0C62.

make question more accurately reflect the problem
Source Link
Cornelius Dol
  • 64.2k
  • 26
  • 142
  • 190

How can I castconvert a string to an integer in C++

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62"; int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; } 
int main() { string bar = "0x00EB0C62";
int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; 

}

So the output should be 0x00EB0C62.

How can I cast a string to an integer in C++

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62"; int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; } 

So the output should be 0x00EB0C62.

How can I convert a string to an integer in C++

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62";
int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; 

}

So the output should be 0x00EB0C62.

formatting
Source Link
Greg Hewgill
  • 1.0m
  • 192
  • 1.2k
  • 1.3k

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62";
int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; 

}

int main() { string bar = "0x00EB0C62"; int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; } 

So the output should be 0x00EB0C62.

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62";
int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; 

}

So the output should be 0x00EB0C62.

I am trying to copy the value in bar into the integer foo.

This is what I have so far. When I run it I get a different hex value. Any help would be great.

int main() { string bar = "0x00EB0C62"; int foo = (int)bar; cout << hex << foo; ChangeMemVal("pinball.exe", (void*) foo, "100000", 4); return 0; } 

So the output should be 0x00EB0C62.

Fix question and add language tag
Link
Cornelius Dol
  • 64.2k
  • 26
  • 142
  • 190
Loading
Source Link
Parkour86
Parkour86
Loading