Author Topic: Fucking Confusing++  (Read 1956 times)

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Fucking Confusing++
« on: 13 November 2002, 13:51 »
I cant get this program to work, i commented on the source more then enough so you should understand it...

Main.cpp
Code: [Select]

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Fucking Confusing++
« Reply #1 on: 13 November 2002, 16:50 »
if (cmdi == "exit")

cmdi is a pointer to a string, so its value will actually just be an address of location in memory. You need to use strcmp to compare the actual contents of the string with "exit":

if (strcmp(cmdi, "exit") == 0)
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


The Auditor

  • Member
  • **
  • Posts: 59
  • Kudos: 0
Fucking Confusing++
« Reply #2 on: 13 November 2002, 18:47 »
I found the problem..
" Microsoft Dos XP Source Code"

I think that sums it up.. LOL

... Sorry.

The Auditor
"You can always die, it's living that takes courage."

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Fucking Confusing++
« Reply #3 on: 14 November 2002, 13:43 »
lol, it will be just another work of art when im finished.

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Fucking Confusing++
« Reply #4 on: 14 November 2002, 13:51 »
Still just exits  :(  does anyone know why <x11 fiddles in vi>...


Im an idiot, sorry i had while exitlevel == 0 because im a complete freekin retard. (Its always a stupidity bug in my programs)

 :D  (Working (except for ver))

....

Ahhh got it... Nother stupidity problem (Gee Ex Eleven must have been really on the pills when posting that)...

Anyway how do you make everything in the cmdi string lower case after input

BASIC EQUIV:

cmdi$ = lcase$(cmdi$)


Thanks in advance!

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Fucking Confusing++
« Reply #5 on: 14 November 2002, 13:53 »
Here is the source, luke  :D

Code: [Select]

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Fucking Confusing++
« Reply #6 on: 14 November 2002, 13:59 »
quote:
Originally posted by Ex Eleven / b0b 2.1:
Anyway how do you make everything in the cmdi string lower case after input

BASIC EQUIV:

cmdi$ = lcase$(cmdi$)



One way of doing it is to use the "tolower()" function. Mind you that this function will only change the case of a single character so you have to loop through your string.
Someone please remove this account. Thanks...

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Fucking Confusing++
« Reply #7 on: 14 November 2002, 14:17 »
Could you do me a favour and write a sample peice of code?

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Fucking Confusing++
« Reply #8 on: 15 November 2002, 02:27 »
Sure:

Code: [Select]
Someone please remove this account. Thanks...

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Fucking Confusing++
« Reply #9 on: 15 November 2002, 08:37 »
Thanks!

Why do old people hate ebject oreiented programming?

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Fucking Confusing++
« Reply #10 on: 15 November 2002, 21:37 »
For the same reason that young people think they know everything.  
Someone please remove this account. Thanks...

Stryker

  • VIP
  • Member
  • ***
  • Posts: 1,258
  • Kudos: 41
Fucking Confusing++
« Reply #11 on: 15 November 2002, 21:44 »
why don't you change the while statement to have it be:

while (exitlevel==0) {

?
Otherwise it will always exit because it's set at 0 default, but if it isn't 1 then it won't go through the loop.

(EDIT)
nevermind, i see someone already got to it.

[ November 15, 2002: Message edited by: Stryker ]


The Auditor

  • Member
  • **
  • Posts: 59
  • Kudos: 0
Fucking Confusing++
« Reply #12 on: 15 November 2002, 21:48 »
I don't think i know everything, i KNOW i know everything..
ROFL

The Auditor

Sorry.. it needed to be said.
"You can always die, it's living that takes courage."

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Fucking Confusing++
« Reply #13 on: 15 November 2002, 21:59 »
I'm not young enough yet to know *everything*.
Someone please remove this account. Thanks...

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Fucking Confusing++
« Reply #14 on: 15 November 2002, 10:09 »
quote:
Originally posted by Stryker:
why don't you change the while statement to have it be:

while (exitlevel==0) {

?
Otherwise it will always exit because it's set at 0 default, but if it isn't 1 then it won't go through the loop.

(EDIT)
nevermind, i see someone already got to it.

[ November 15, 2002: Message edited by: Stryker ]



Yea that was a "stupidity" bug that i accidentaly did... Im always slightly drunk... so i do a lot of that. But my perants apparently are going to put me in AA.