Forum: C++ Jun 21st, 2009 |
| Replies: 4 Views: 589 In your linker settings have you typed in the complete path to where fltk.lib is located ? By default it'll look for it in the current project directory. If fltk.lib is something you are supposed to... |
Forum: C++ Jun 3rd, 2009 |
| Replies: 5 Views: 293 What errors do you get from the compiler ? |
Forum: C Jun 3rd, 2009 |
| Replies: 3 Views: 306 I would clean up the printf a bit by making it more readable. Also I am not sure why you are passing the argument "&menu" to your printf. Its incorrect in this context.
Something like this would... |
Forum: C++ Oct 30th, 2008 |
| Replies: 8 Views: 929 You could just have a pointer called "start" and when "current == start" you can set the input as you need. |
Forum: C++ Oct 29th, 2008 |
| Replies: 8 Views: 929 I don't think just L and R will cut it.
Lets say your maze is a rectangle that has n number of points, and there are walls inside it that construct a number of paths. Now the user needs to take... |
Forum: C++ Oct 24th, 2008 |
| Replies: 4 Views: 517 Are you positive you have the shared library wld.so in your
/home/vincenzo/software/borealis-projects/LoadDistributionTool ?
And what is this supposed to be ? ${BOREALIS}/nmstl/bin/wtf ? its... |
Forum: C++ Oct 24th, 2008 |
| Replies: 5 Views: 589 I think what is happening is this
Tblk A;
Tblk B = A;
This is using a default copy constructor since you haven't defined one, and both your objects A and B are pointing to the same set... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 7 Views: 596 Here is a decent example Link (http://marknelson.us/1996/01/01/priority-queues/) |
Forum: C++ Oct 22nd, 2008 |
| Replies: 7 Views: 596 Your priority_queue should be building a max_heap with the highest value at the top. Have you tried printing the contents of your queue after you finish building it, to see if the elements are in... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 4 Views: 724 Here is a tutorial on bucket or bin sort. Link (http://en.wikipedia.org/wiki/Bucket_sort)
Each array of yours will be a bucket. You can create as many arrays as the buckets you'll need. Then sort... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 6 Views: 1,516 strange. it works for me. here is my output.
Enter a sentence:
I have 200 apples
Number of vowels: 5
Number of digits: 3
s
e |
Forum: C++ Oct 22nd, 2008 |
| Replies: 7 Views: 596 When you insert your elements into the queue, you have to insert them so that the timestamps are sorted in descending order. That way when you dequeue your first element, you should get the correct... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 6 Views: 1,516 Well .. I have no idea why your teacher would say that, but its really bad practice.
Now onto your code. Surprised it didn't crash. Your store_char() function does not have i initialized, and... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 6 Views: 1,516 First of all, its good practice is to put your class declarations in a header or a .h file, put your definitions in a .cpp file and then include the .h file, where needed.
You really should not... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 7 Views: 596 I am a little confused by your queue implementation. Usually your queue functions would be enqueue to add the elements to the queue, and dequeue to get the first element you added off the queue,... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 12 Views: 937 Very interesting :). I had no idea about this. Thanks Salem. |
Forum: C Oct 21st, 2008 |
| Replies: 6 Views: 519 A void function would generally look like this
void foo(){
return;
}
But trying to do this is wrong. |
Forum: C++ Oct 21st, 2008 |
| Replies: 2 Views: 1,201 Well your variables below are local to the function. So when you leave the function, they don't exist and so their addresses now probably point to garbage values.
You should copy the values over... |
Forum: C++ Oct 21st, 2008 |
| Replies: 12 Views: 937 Also in addition to the braces, your logic is messed up. See the comments in your code.
for ( int i = 2 ; i < num; i++ )
/* you can add a special case for 2, you only need to check for... |
Forum: C++ Oct 21st, 2008 |
| Replies: 8 Views: 528 Its not deleting 3 numbers. Your for loop prints the numbers starting at index i instead of 0, so you "think" they are deleted.
You might want to delete the number and then call your print... |
Forum: C++ Oct 21st, 2008 |
| Replies: 12 Views: 937 I am curious ..
how did you get this to compile ?
if ( ( i == 2 ) or ( i % 2 != 0 ) )
There is no keyword called "or" in C++ its denoted by "||" |
Forum: C++ Oct 21st, 2008 |
| Replies: 8 Views: 528 are you sure it doesn't work ? it removes it correctly when I try using your code. |
Forum: C Oct 21st, 2008 |
| Replies: 3 Views: 817 Pass them in as pointers from your calling function.
void fbExeCode(int BldCnt, char* fCodeAddr, char* tmpAddr){
}
A few things to be careful about. If you want to allocate them in... |
Forum: C++ Oct 21st, 2008 |
| Replies: 8 Views: 528 You aren't assigning the variable index a value before calling the functions removeAt and insertAt. So you need to fix that first.
Well I just noticed that you are asking for the index in your... |
Forum: C++ Oct 19th, 2008 |
| Replies: 16 Views: 1,206 Looks good ! I have one suggestion.
Instead of having a standard array "steps" you could write a BaseGenReverse, similar to your teacher's BaseGen function and use that instead. So if the size... |
Forum: C++ Oct 18th, 2008 |
| Replies: 15 Views: 1,369 I'd suggest putting some print statements inside your scanipport function and that will help you pinpoint the line which is causing the error. Use thread_id() to print the thread#, so you can see... |
Forum: C++ Oct 18th, 2008 |
| Replies: 15 Views: 1,369 Your gdb error says that your program is crashing inside a memcpy somewhere. Now I don't see any other memcpy's in the code you posted, but you might want to switch to a single threaded run, and then... |
Forum: C++ Oct 18th, 2008 |
| Replies: 25 Views: 1,859 Well I am not sure how things would work, if you had parts of it pre-approved by professionals. From what I know, and what I've seen my classmates do, pretty much all of their theses had to be read,... |
Forum: C++ Oct 18th, 2008 |
| Replies: 2 Views: 549 lol .. contrary to popular belief, we are not clairvoyant, so you need to elaborate on what you are doing , what your problem is and post some code you've worked on !! |
Forum: C++ Oct 18th, 2008 |
| Replies: 4 Views: 1,130 comparsions are case sensitive, so you will need to use either toupper or tolower to make them the same.
I am not sure what you mean by not allowing the punctuation. But what the function strtok... |
Forum: C++ Oct 18th, 2008 |
| Replies: 5 Views: 4,172 Here is a link that mentions how the fstream getline works Link (http://www.cplusplus.com/reference/iostream/istream/getline.html)
What you need to do is
SortedBinary.getline(myBuffer,... |
Forum: C++ Oct 18th, 2008 |
| Replies: 16 Views: 1,206 You don't need to make your program distinguish between a decimal and a binary input. All you need to do is prompt a user for a decimal number and then send it to your routine.
A couple of things,... |
Forum: C++ Oct 18th, 2008 |
| Replies: 15 Views: 1,369 Again, there is only one memcpy() in your code, so I'll go with that
memcpy(&servaddr.sin_addr, hostaddr->h_addr, hostaddr->h_length);
your hostaddr is a pointer to the struct, which you... |
Forum: C++ Oct 18th, 2008 |
| Replies: 16 Views: 1,206 Here is an article that elaborates on how you can convert a decimal number to a binary.
Link (http://www.wikihow.com/Convert-from-Decimal-to-Binary) |
Forum: C++ Oct 18th, 2008 |
| Replies: 15 Views: 1,369 Well I see in your main() function
scout *p;
and then
p[s].ips = bohica;
p[s].startport = start;
p[s].endport = end; |
Forum: C++ Oct 18th, 2008 |
| Replies: 16 Views: 1,206 Sigh !!
All you need to do is write a function using the prototype
string DtoB (int Decimal)
that takes a decimal number <= 255 as the input, converts it to its binary form, stores the... |
Forum: C++ Oct 18th, 2008 |
| Replies: 8 Views: 498 Add Code Tags Please !!!
And there is no #include<iostream.h>
its #include<iostream> |
Forum: C++ Oct 18th, 2008 |
| Replies: 12 Views: 1,288 One thing, which may or may not be a problem, is this
if (validAccount == false) {
.....
switch(AccountType) {
case 's':
case 'S':
....
validAccount = true; |
Forum: C++ Oct 18th, 2008 |
| Replies: 25 Views: 1,859 I never wrote a thesis for my Masters, did more of a set of research papers, but honestly I haven't come across any that are more than a few hundred pages.
On a practical side, you do understand... |
Forum: C++ Oct 18th, 2008 |
| Replies: 6 Views: 713 At first glance, your traverse function is declared as a void, yet you are doing
result = tree.traverse(INFIX, printData(data));
This is not valid. I don't know what result is, but if its a... |