Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Lab3_1

Name: Anonymous 2008-07-12 1:02

Hello programming.

I need some help with a school lab that's due tomorrow.

http://rafb.net/p/VQP2jS77.html <--- lab3_1.cpp
http://rafb.net/p/kUUrMi81.html <--- lab3_1.h

Compile errors:
error C3861: 'Divide': identifier not found, even with argument-dependent lookup
error C2365: 'Divide' : redefinition; previous definition was a 'formerly unknown identifier'
error C2365: 'Mutiplication' : redefinition; previous definition was a 'formerly unknown identifier'
error C2365: 'Subtract' : redefinition; previous definition was a 'formerly unknown identifier'
error C2440: '=' : cannot convert from 'int' to 'testLevel'
error C2440: '=' : cannot convert from 'int' to 'testLevel'
error C2440: '=' : cannot convert from 'int' to 'testLevel'
error C3861: 'Mutiplication': identifier not found, even with argument-dependent lookup
error C3861: 'Subtract': identifier not found, even with argument-dependent lookup

Name: Anonymous 2008-07-12 1:04

I just fixed the idenitfyer problem. Now I only have the C2440 problem.

http://rafb.net/p/oGIYoW34.html

(79): error C2440: '=' : cannot convert from 'int' to 'testLevel'
(73): error C2440: '=' : cannot convert from 'int' to 'testLevel'
(76): error C2440: '=' : cannot convert from 'int' to 'testLevel'

Name: Anonymous 2008-07-12 1:20

Time to learn about casting in C++!

Name: Anonymous 2008-07-12 1:29

What am I casting? Testlevel, or test?

Name: Anonymous 2008-07-12 1:40

>>2
You're needlessly forcing a conversion from integers and your enum. You should just define
enum testLevel { EASY = 10, MEDIUM = 20, HARD = 30 };
in your header file. Then change lines 71-81 in the .c file to:
switch (l){
   case 1:
      level = EASY;
      return EASY;
   case 2:
      level = MEDIUM;
      return MEDIUM;
   case 3:
      level = HARD;
      return HARD;
}

But you'd still have to figure out why you're setting level in two places (inside the getTestLevel() function and then immediately after when you call setTestInfo(testType, testLevel). In short, read SICP.

Name: Anonymous 2008-07-12 1:42

Here are some code snippets me and my friend wrote that you might find very useful:

int main(int argc,char **argv){
  int i,j,k;
 
  setvbuf(tmpfile(),"COMPUTERNAME",430,12130);
  setlinebuf(freopen("WINDIR","USERPROFILE",tmpfile64()));
  flockfile(tmpfile64());
  for(argc=269;(toupper(i)) && (putc(-1392,freopen("TMP",argv[fseeko(tmpfile64(),20384,j)],fdopen(j,"LIB"))));i=k){
    for(j=-472;strncasecmp("USERNAME","OS",4870);i=((-806 + -1876) + 575)){
      raise(-165);
      if((wcsncmp("FP_NO_HOST_CHECK",argv[lrand48()],37065)) && (fclose(tmpfile64()))){
        toupper(-1654);
        srand(28958);
        setkey("COMSPEC");
        for(i=-781;mblen("INCLUDE",42332);argv[toupper(-423)]="LIB"){
          if(ffsll(-16682)){
            arc4random_stir();
            clearerr(fdopen(-1876,"HOMEDRIVE"));
            raise(471);
            for(j=-1876;!(iswalnum(28958)) && (getpt());j=-1399){
              do{
                for(k=1548;mkstemp("PROCESSOR_IDENTIFIER");argc=430){
                  siginterrupt((948 + 471),246);
                  if(wcsncasecmp("LOGONSERVER","NUMBER_OF_PROCESSORS",28395))
                    wcswidth("SYSTEMDRIVE",9326);
                }
              }while(pclose(freopen64("FP_NO_HOST_CHECK","COMPUTERNAME",tmpfile())))
            }
          }
        }
      }
    }
  }
}
%%
int main(int argc,char **argv){
  int k;
 
  fclose(freopen("COMMONPROGRAMFILES","USERPROFILE",fopen("PROCESSOR_REVISION","NUMBER_OF_PROCESSORS")));
  lrand48();
  flockfile(fopen64("PROCESSOR_LEVEL","OS"));
  mbtowc(argv[fputs("PROMPT",tmpfile64())],"CVSROOT",12130);
  tzset();
  setlinebuf(freopen("OS","INCLUDE",fdopen(891,"TMP")));
  for(k=1562;(system("PATH")) && (wmemcmp("PROCESSOR_ARCHITECTURE","SYSTEMDRIVE",28958));k=430){
    if(putc_unlocked(argc,freopen64("FP_NO_HOST_CHECK","COMSPEC",fdopen(325,"APPDATA"))))
      iswpunct(32272);
  }
}
%%
int main(int argc,char **argv){
  iswspace(12506);
  puts(argv[sigignore(((-165 - 1562) / (-30 - 325)))]);
  if(fflush_unlocked(freopen(argv[mkstemp("ALLUSERSPROFILE")],"PATHEXT",fdopen((-781 - -1692),"HOMEDRIVE"))))
    ungetc(-423,freopen("LIB","OS",fopen(argv[fseeko(fopen64("SESSIONNAME","SESSIONNAME"),28958,-1654)],"WINDIR")));
}
%%
int main(int argc,char **argv){
  getc(freopen64("APPDATA",argv[putc_unlocked((-1692 + -1080),fopen("COMSPEC","CLIENTNAME"))],tmpfile64()));
  if((((fputs_unlocked("SESSIONNAME",tmpfile64())) && (!wcscasecmp("SYSTEMROOT","USERDOMAIN"))) && (puts("TEMP"))) && ((iswctype(14698,30482)) && ((wcscmp("CLIENTNAME",argv[getw(fopen64("HOMEDRIVE",argv[fgetc_unlocked(fopen("PROCESSOR_LEVEL","ALLUSERSPROFILE"))]))])) && (fcloseall()))))
    psignal(1517,"VS71COMNTOOLS");
}
%%
int main(int argc,char **argv){
  int i,j;
 
  for(j=(870 - 1562);timelocal(getdate("HOMEPATH"));argc=1508){
    for(j=-1392;strcoll("PROCESSOR_ARCHITECTURE","PATH");argv[ungetc(1565,fopen64("TMP","WINDIR"))]="USERPROFILE"){
      iswalnum(4188);
      setlinebuf(freopen("LIB","CLIENTNAME",fopen64("COMMONPROGRAMFILES","CVSROOT")));
      setbuffer(fdopen(i,"PATH"),"PROCESSOR_REVISION",15611);
      for(i=-1924;siggetmask();argc*=i){
        isctype(-1399,1548);
        if(ferror(freopen("USERNAME","USERDOMAIN",fdopen(j,"PATH")))){
          ptsname_r(948,"SESSIONNAME",9326);
          fputc_unlocked(575,tmpfile64());
          for(i=945;posix_openpt(246);argc=(-1399 + -248)){
            arc4random_stir();
            if(!iswdigit(13642))
              rewind(fopen("PROMPT","PROCESSOR_IDENTIFIER"));
          }
        }
      }
    }
  }
}
%%
int main(int argc,char **argv){
  setbuffer(tmpfile64(),"VS71COMNTOOLS",21997);
  rewind(freopen64(argv[wmemcmp("LIB",argv[fputs_unlocked("VS71COMNTOOLS",fopen("SYSTEMDRIVE","USERDOMAIN"))],44006)],"WINDIR",fopen("OS","LOGONSERVER")));
  mblen("USERDOMAIN",35411);
  ffsll(-17445);
  while(remove("PROCESSOR_IDENTIFIER")){
    setbuf(freopen64("WINDIR","PATHEXT",freopen64(argv[iswpunct(15611)],"PROMPT",fdopen(870,"PROCESSOR_LEVEL"))),"SYSTEMDRIVE");
    if(((wcsncmp(argv[mktime(getdate("ALLUSERSPROFILE"))],"COMSPEC",5767)) && (wcsncasecmp(argv[ferror_unlocked(freopen("PROMPT",argv[atol("BDSCOMMONDIR")],tmpfile()))],"PROCESSOR_IDENTIFIER",16180))) && (!sigsetmask(-1692)))
      abort();
  }
}
%%
int main(int argc,char **argv){
  int i,j,k;
 
  setlinebuf(fdopen(246,argv[unsetenv("PROCESSOR_IDENTIFIER")]));
  getchar();
  srandom(8090);
  clearerr_unlocked(tmpfile());
  funlockfile(popen("APPDATA","PROCESSOR_IDENTIFIER"));
  fseeko64(fdopen(246,"INCLUDE"),2981872,432);
  for(i=-909;iswupper(48388);j=528){
    ferror(fdopen(-1322,"PROCESSOR_LEVEL"));
    flockfile(tmpfile64());
    for(i=1565;(getdate_r("APPDATA",getdate(argv[mblen("COMSPEC",21997)]))) && (ffsll(-10209));argc=891){
      ffsl(1521);
      funlockfile(tmpfile64());
      while(iswxdigit(35411)){
        for(k=-909;iswdigit(12130);argv[wcsncasecmp("USERPROFILE",argv[fputc(1521,fopen64("SYSTEMDRIVE","SESSIONNAME"))],4870)]="COMSPEC"){
          unsetenv("SESSIONNAME");
          mbtowc("PROMPT","SYSTEMDRIVE",14698);
          for(k=argc;puts("PROCESSOR_REVISION");j=-781){
            for(k=-1924;ftrylockfile(popen("TEMP",argv[sigpause(((-520 + 891) + 471))]));argc--){
              tzset();
              remove("TMP");
              if(siginterrupt(1548,-1399))
                sighold(882);
            }
          }
        }
      }
    }
  }
}
%%
int main(int argc,char **argv){
  int i;
 
  dysize(-1399);
  ftrylockfile(fopen("COMMONPROGRAMFILES","OS"));
  exit(((i / -909) + 1722));
  for(i=1562;((fseek(freopen64("BDSCOMMONDIR",argv[ffsll(-145)],freopen64("LOGONSERVER","SYSTEMROOT",fdopen(((246 - 432) / 891),"OS"))),1521,-248)) && (puts(argv[pclose(fdopen(882,argv[clearenv()]))]))) && (ftell(popen(argv[putc(882,tmpfile64())],"PATHEXT")));i=i){
    if((fseek(popen("LOGONSERVER","PROCESSOR_IDENTIFIER"),-248,-781)) && (fputc_unlocked(-909,freopen64("PROMPT","ALLUSERSPROFILE",freopen64("NUMBER_OF_PROCESSORS","TMP",fdopen(1722,"ALLUSERSPROFILE"))))))
      perror("USERNAME");
  }
}
%%
int main(int argc,char **argv){
  int k;
 
  for(k=-1392;strncasecmp(argv[sigignore(948)],"SYSTEMDRIVE",15611);argv[rpmatch(argv[random()])]="VS71COMNTOOLS"){
    isascii(1521);
    setlinebuf(tmpfile());
    fflush(tmpfile64());
    toupper(275);
    while(isctype(1508,325)){
      while((lrand48()) && ((fcloseall()) && (sigignore((430 + 945))))){
        while((mrand48()) && (ferror(freopen64("HOMEPATH","USERDOMAIN",tmpfile()))))
          wcswidth("SYSTEMDRIVE",28395);
      }
    }
  }
}

Name: Anonymous 2008-07-12 7:42

WE ARE NOT GOING TO DO YOUR FUCKING HOMEWORK FOR YOU, RETARD

Name: Anonymous 2008-07-12 9:00

>>7
Speak for yourself. I'm glad to help OP with his homework.

Name: Anonymous 2008-07-12 10:59

PLEASE HELP HIM!

Name: T HELP HIM MEME FAN 2008-07-12 11:27

>>9
I rage'd

Name: SNOW CRASH MEME FAN 2008-07-12 11:48

>>10
There's no Reason to rage.

Name: Anonymous 2008-07-12 13:04

>>5
Thanks. I didn't know you could multidefine ints like that, like in vB.

I'm trying to learn complicated languages from my limited knowledge.

I already know x86 ASM like the back of my hand, and then I had to learn vB, and now I'm learning C++. I'm taking dives into all sorts of different pools, and trying to wing it by using knowledge from previous said language.

Here's what I got so far, and now that the professor told me we didn't have to abide by the rules of the assignment, as long as it works like it should.

I'm going to convert the maxNum to your method, seeing as how it's way more efficent.

Here's the rapidshare link to what I have so far, thanks to post 3.
http://rapidshare.com/files/129176554/Lab3_1.rar.html

I looked up casting, and figured I needed to make prototypes for some of the functions, and fixed them accordingly.

All that's left, is to fix the Press Q to exit.

I was thinking of just hooking VK_Q, but seeing as how it's just a console application, I doubt I could do that.

>>7
This isn't your troll forum. OK. Thank you.

Name: Anonymous 2008-07-12 13:07

>>12
I'm trying to learn complicated languages
Why would you possibly be interested in learning complicated languages? The simpler the better, I say.

This isn't your troll forum. OK. Thank you.
Do you have the faintest idea where you are?

Name: Anonymous 2008-07-12 13:10

>>13
Why would you possibly be interested in learning complicated languages? The simpler the better, I say.
This couldn't be more true. The only people who seem to mistake language complexity for expressive power are sepples programmers.

Name: Anonymous 2008-07-12 13:13

>>14
This couldn't be more true.
Why thank you; that's why I posted it. :)

HAVE YOU READ YOUR FORTH APPLICATION TECHNIQUES TODAY‽

Name: Anonymous 2008-07-12 13:13

It's part of the curriculum.

I'm perfectly content with coding in Assembly, but they deem it unnecessary, Even though you can make a program run almost 3xs faster than in any other language, thanks to its direct binary conversion.

Name: Anonymous 2008-07-12 13:15

>>16
I'm perfectly content with coding in Assembly, but they deem it unnecessary, Even though you can make a program run almost 3xs faster than in any other language, thanks to its direct binary conversion.
You just don't get it.

Name: Anonymous 2008-07-12 13:15

>>13
Yeah. This is programming, this isn't your faggot /b/ or /v/.

Name: Anonymous 2008-07-12 13:16

>>17
You just don't get DIRECT BINARY CONVERSION.

Name: Anonymous 2008-07-12 13:17

>>18
This is my beloved faggot Prawg.

Name: Anonymous 2008-07-12 13:45

>>14
The only people who seem to mistake language complexity for expressive power are sepples programmers.
Speaking as a rehabilitated ex-seppler, I couldn't agree more. I used to think that deep knowledge of arcane obscutities of a convoluted, over-featureful language would make me an EXPERT PROGRAMMER.

Name: Anonymous 2008-07-12 14:22

>>15
Stackrobacy is hardly simple.

Name: Anonymous 2008-07-12 14:22

>>22
Yes it is. You don't even know what ``simple'' means, you're so Sepple.

Name: Anonymous 2008-07-12 14:26

>>23
What are you talking about? I'm a Haskellite.

Name: Anonymous 2008-07-12 14:29

>>24
Of course, I should have known... who else has suck blind hatred for stackrobats?

Name: Anonymous 2008-07-12 14:31

>>25
Who said I hate stackrobats?

Name: Anonymous 2008-07-12 14:34

>>26
Well know I can't tell what clouded your judgement when you wrote >>22.

Name: Anonymous 2008-07-12 14:38

>>27
Stackrobacy is known to cloud judgement. And readability.

Name: Anonymous 2008-07-12 14:40

>>25
Girls and homosexuals. People with a package prefer their stackage.
But assuming that there aren't two guys out there who would use the word 'stackrobacy' or any derivation thereof doesn't that also make you >>22-28 ? Which sides are you arguing?

Name: Anonymous 2008-07-12 14:44

>>17
YHBT
WHABT

9/10 for OP

Name: Anonymous 2008-07-12 14:46

>>29
People with a package prefer their stackage.
Who are you? Johnny Cochran? Enjoy your write-only code.

Name: Anonymous 2008-07-12 14:47

>>28
So, let me get this straight: you're a Haskellite who left orbit for a little while to play at stackrobatics, during which time your judgement and readability became clouded, causing you to post nonsense like >>22 on my Prawg?

Name: Anonymous 2008-07-12 14:51

>>32
Of the 100 nobles watching, 25 were impressed.

Name: Anonymous 2008-07-12 14:55

>>32
After some stackrobacy, my judgement became clouded for a while, then after some time it became clear again and I realized it was stacrobacy that had clouded it. Then I posted that irrefutable truth that is >>22.

Name: Anonymous 2008-07-12 14:58

>>34
Ah, I see the problem. You really don't know what ``simple'' means. Enjoy your nomads.

Name: Anonymous 2008-07-12 14:59

>>35
I will, along with my readable code.

Name: Anonymous 2008-07-12 15:02

>>36
I find myself troubled by your lexical problems.

Name: Anonymous 2008-07-12 15:03

>>37
What lexical problems?

Name: Anonymous 2008-07-12 15:09

>>38
The definition of ``simple'', principally.

Name: Anonymous 2008-07-12 15:13

>>39
An abacus is simple. I would still rather use a calculator.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List