Compiler seems to be hanging up on "new" but I know it isn't but I can't seem to figure out what it is that it doesn't like. Been chasing my tail for the last couple of days. Any help would be greatly appreciated.
Here's is the compiler message: InventoryItemDe mo.java:9: cannot find symbol
symbol : constructor InventoryItem(j ava.lang.String ,int)
location: class InventoryItem
InventoryItem Item1 =...
User Profile
Collapse
-
cannot find symbol error
-
As it turns out the problem above was simple and yes I am an idiot. I had a # include in one of my files that was in lower case but my file name was in upper case. Once I changed the include the program runs. Still not error free but at least I can run it and track down the errors.
Not to worry, y'al haven't heard the last of me.
Thanks so much for being here -
Program that does nothing
I have what I hope will be a simple question but then again I hope it's not simple so I don't have to feel like an idiot.
I built this program and it used to work but I added on to it and it stopped working. Does absolutely nothing. I started deleting lines of code and it still doesn't work. Any help would be greatly appreciated.
[code=c]
int option; /*. . .and other variable declarations were here*/
... -
I figured out the previous problem and created a new one for myself. Ain't that always the way. The problem with the other code was line 14 I didn't pass a value to linewithblanks so the not would never be true and it hops out of the loop and continues on it's merry little way.
Why waste a good thread . . . Now for the new problem. I seem to have created an infinite loop for myself. I only removed the if linew/... and it accompanying...Leave a comment:
-
Not executing the body of a if statement
I think the program recognized that it has found a match because it no longer gives me the Undefined Command message but it will not execute the body of the if statement.
Here's my handy dandy code. Please let me know if anything is unclear from this snippet. I am never sure how much of the code I need to provide.
...Code:// Loop until there are no more commands in input file while ( fgets ( cmdStr, BUFLEN, fin ) != NULL
-
This is what the finished piece of code looks. It reads the files correctly and kicks out the errors line. (some of the problem I was having was because there were spaces at the end of the lines in my datafile) I wish I could say that I am thrilled with my work but I still have a math error in figureAverages. I think it's because I am putting a character string into an integer variable and then trying to do math with it. I am ready to let it...Leave a comment:
-
Thanks banfa that was my error. There should not be a comma between the %d's when scanf'ing the second line. I am considering going back to an immediate sscanf without error checking then seeing if I can develop some sort of post error checking. If a line has an error I can decrement my incrementor then move on to test the next structure in the array.Leave a comment:
-
I do have limited guarantees as to the format. I am allowed to assume that each account will consist of 4 lines of data though there may be empty lines in between. The name may not always come first, they may try to include an extra name on the same line (Jane Doe - OK, Mary Jane Doe - Not OK) they may have more or less than the allowable homework and exam grades so I need to be able to handle those sorts of things. I don't have to worry about...Leave a comment:
-
still having trouble adding to the array of structures in C
Sorry I was not clear in my earlier post. Banfa you did a great job in devining what my structure should look like. I have it declared as:
typedef struct student
{
char fName [NAME_LEN];
char lName [NAME_LEN];
int id;
int hw [NUM_HW];
int exm [NUM_EXM];...Leave a comment:
-
I slammed my violin of course. Though not on purpose. I have no idea whether my musical experience makes me a better or worse programmer I seem to be equally bad at both. I think I understood music better, I just couldn't make it sound like I wanted. Yeah 'bout like my programs. They just won't do what I want.Leave a comment:
-
I used to play violin
One night on my way out of the auditorium I slammed it in the door and thus ended my musical career. I am hoping progrmming will work out better for me.
Every now and then I think of teaching myself keyboard, maybe someday I will have time for that sort of thing.Leave a comment:
-
what's the difference between *a = *b and a = b
I will go ahead and give you a little background for what I am working on, though I have been hazy on pointers for some time. I get that a pointer points to an address in memory. Today I just learned what dereferencing means (I don't think it sounds like what it does).
I am working with linked lists which are pointer intensive. I have a list and two pointers of linkedList type (they have a data section and pointer section called... -
Dream job
I would love to make educational software. Everysince I was a little I wanted to work on Sesame Street, when I saw they had come out with learning software I thought I had found my calling. I want to work in a relaxed environment and feel that I am helping someone. If someday all this frustration pays off other than monetarily that would be ideal.Leave a comment:
-
Reading from a file into an array of structures
I will admit that lots of times the obvious eludes me and this is most likely one of those times but if anyone has any ideas on what I can do to make this code work, I would greatly appreciate it. Here's the code:
...Code:while ( ( fgets ( buf, BUFLEN, fin ) ) != NULL ) /* pulls a line from "fin" up to the length of BUFLEN and stores it in "buf" */ { rmNl ( buf ); /* remove new line */ if ( !lineWithBlanksLast edited by Niheel; Mar 1 '06, 02:02 AM.
No activity results to display
Show More
Leave a comment: