Author Topic: uncompiled source code?  (Read 5757 times)

0 Members and 1 Guest are viewing this topic.

Offline Hippo

  • Darth water-horse
  • 211
  • Grazing.
    • All Hands to War
Re: uncompiled source code?
you can stream numbers into a string, but you can't perform math on them... for the purpose of what he posted, a string consiting of numbers works
VBB Survivor -- 387 Posts -- July 3 2001 - April 12 2002
VWBB Survivor -- 100 Posts -- July 10 2002 - July 10 2004

AHTW

 

Offline takashi

  • Better than TrashMan
  • 29
Re: uncompiled source code?
b+a+c

fixed! if a word counts as a value.....

 

Offline Flipside

  • əp!sd!l£
  • 212
Re: uncompiled source code?
you can stream numbers into a string, but you can't perform math on them... for the purpose of what he posted, a string consiting of numbers works

Well, it was this part that confuses me...

Code: [Select]
// declaring variables:
  int a, b, c;

When compared with this...

Code: [Select]
cout << " enter a noun: ";
  cin >> b;

To my mind, entering text into an Integer defined variable would cause a crash, though, I'll freely admit, I haven't got round to learning C++ yet, hell, they're making me code in VB.net at the moment, that's like Frontpage meets Access and a thoroughly horrible experience :(

Also, from personal experience, I find you tend to need to define the variable before you start filling them, however, this just may be part of how C++ works.

Edit2: Ah my mistake, they are defined twice, though b is still set as an integer.
« Last Edit: March 14, 2007, 07:07:55 pm by Flipside »

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: uncompiled source code?
You cannot assign a String an Int value, Int values are signed Integer, usually 2 Bytes long, which allows you to hold a number between 32767 and -32768, but that's all. Assigning a variable to it will either result in an error or a bogus result.

Int should be 4 bytes (32-bits) on 32-bit processors which are the norm nowadays.
-C

 

Offline Flipside

  • əp!sd!l£
  • 212
Re: uncompiled source code?
Heh, true, some of my coding knowledge is a little out of date ;)

 

Offline takashi

  • Better than TrashMan
  • 29
Re: uncompiled source code?
when its finished (and better) i will release the username generator, or even maybe bundle it up with fs2 after some changes.