Assignment 1 TroubleShooting

I am trying to compile with the testfile using:

g++ bconsole.cpp console.cpp cio_test.cpp -lncurses -Wno-write-string

This gives me an error saying the main (the tester file) is not defining “console” properly.  The errror is:

cio_test.cpp:122:7: error: âconsoleâ was not declared in this scope

For the line:

r = console.getRows(); // at line 122, first occurance of use of console.

I am creating console through the included files.  My console classes are exactly the same as the ones on the website.  Except I filled in switch statement.  Why is it giving me this error and how should I fix it?  Am I not including a certain file or compiling wrong?

Posted in Uncategorized | Tagged , | Leave a comment

Assignment 1 Update

Hello again,

So basically I have been only working on the assignment lately due to mostly being busy with other things.   Mostly I have completed the edit function, but have run into issues on how to set characters.  

After a little research I have figured out how to do so.  I am now currently working on the function and and waiting for the cio_test.cpp to e realeasd to know what is due in the following weeks.  One of my main problems is I dont know how to clear the middle of the present field given in the tester example.  This causes a major problem becasue I am not sure if I am suppose to somehow recall the prnBox within edit or do I exit edit and create a statement to check if the main will see if the values have been changed. 

All in all its been a good couple of days.  Lots of work is getting done.

 

Posted in Uncategorized | Tagged , , | Leave a comment

Assignment 1 Bconsole

Bconsole Problem/Misunderstanding:

The BConsole has various decelerations for a number of the functions each of which are declared multiple times.  These functions  putChar(), getChar() amongst more, also have multiple instances, but have the same arguements being passed in to the function.

Currently I have not edited any of the functions other than commenting out:

//while(!done){

//display UI for user

//}

I have done this because it seems to get into and endless loop somewhere in the program and doesn’t output to anything on the screen.   Also the code above is and endless loop so logically it is the first thing to do. 

After doing this I decided to printout everything and do a walk through,  but my question is how does the program know what instance of setPos or getChar to call.

Any help would be appreciated, and would like to hear from you guys or if anybody found any solutions that would be even better.

 

 

 

Posted in Uncategorized | Tagged , , | 1 Comment

Weekly Exercise 2 — Issues

So,  I have successfully commented out anything to do with manager and compiled it successfully.  I have tried to include the Manager class as well and was unsuccsesful.  I am getting caught up at this point. 

Manager.cpp: In member function ‘void Manager::getWorkerHours(Employee*)’:
Manager.cpp:11:38: error: request for member ‘getID’ in ‘emp’, which is of non-class type ‘Employee*’
Manager.cpp:11:71: error: request for member ‘getHours’ in ‘emp’, which is of non-class type ‘Employee*’
Manager.cpp:12:35: error: request for member ‘getName’ in ‘emp’, which is of non-class type ‘Employee*’
Manager.cpp:13:23: error: request for member ‘getHours’ in ‘emp’, which is of non-class type ‘Employee*’

So I figured the problem was maybe it was a pointer and that was the error, but once again I am still stuck.  here is the output.

Manager.cpp: In member function ‘void Manager::getWorkerHours(Employee)’:
Manager.cpp:9:6: error: ‘emp’ has incomplete type
Manager.h:1:7: error: forward declaration of ‘struct Employee’

I am wondering do I make it so its inherited or two separate classes?

Posted in Uncategorized | Leave a comment

My night trying to write mains.

My night trying to write mains.

Hey guys and girls,

So I spent my whole night trying to write a main for the second question.  My problem I ran into was that memory allocation was dynamic and if the variables were not the same size the bigger one, due to the way memory is allocated, would not allocate due to sizes.  So basically I tried to allocate my own memory using realloc.  LOLz because I found this: http://www.iso-9899.info/wiki/Why_not_realloc which basically said everything I was doing was wrong.  So I just hardcoded a couple strings and know it works.  Plus I could also severely damage my machine by doing this.   Anyways Ill post my code to github.  

Posted in Uncategorized | Tagged , , , | Leave a comment

Hello World!

This is my first blog post.

Posted in Uncategorized | Leave a comment