Showing results 1 to 40 of 302
Search took 0.02 seconds; generated 1 minute(s) ago.
Posts Made By: stilllearning
Forum: C++ Oct 30th, 2008
Replies: 8
Views: 430
Posted By stilllearning
Re: Pointer / Linked list question

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: 430
Posted By stilllearning
Re: Pointer / Linked list question

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 the...
Forum: C++ Oct 24th, 2008
Replies: 3
Views: 201
Posted By stilllearning
Re: Linker not working

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 not...
Forum: C++ Oct 24th, 2008
Replies: 5
Views: 331
Posted By stilllearning
Re: Where is the Memory Leak ?

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 of...
Forum: C++ Oct 23rd, 2008
Replies: 7
Views: 339
Posted By stilllearning
Re: priority_queue help

Here is a decent example Link (http://marknelson.us/1996/01/01/priority-queues/)
Forum: C++ Oct 22nd, 2008
Replies: 7
Views: 339
Posted By stilllearning
Re: priority_queue help

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: 326
Posted By stilllearning
Re: bucket or radix sort not sure but need help

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: 539
Posted By stilllearning
Re: Printing array of characters backwards

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: 339
Posted By stilllearning
Re: priority_queue help

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: 539
Posted By stilllearning
Re: Printing array of characters backwards

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: 539
Posted By stilllearning
Re: Printing array of characters backwards

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 be...
Forum: C++ Oct 22nd, 2008
Replies: 7
Views: 339
Posted By stilllearning
Re: priority_queue help

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: 553
Posted By stilllearning
Re: Prime Number

Very interesting :). I had no idea about this. Thanks Salem.
Forum: C Oct 21st, 2008
Replies: 6
Views: 318
Posted By stilllearning
Re: HELP!!!!

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: 530
Posted By stilllearning
Re: C++ Array pointer problem

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: 553
Posted By stilllearning
Re: Prime Number

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 the...
Forum: C++ Oct 21st, 2008
Replies: 8
Views: 326
Posted By stilllearning
Re: Need help removing number from an array

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 function.
Forum: C++ Oct 21st, 2008
Replies: 12
Views: 553
Posted By stilllearning
Re: Prime Number

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: 326
Posted By stilllearning
Re: Need help removing number from an array

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: 376
Posted By stilllearning
Re: How to return 2 values from function

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 fbExeCode,...
Forum: C++ Oct 21st, 2008
Replies: 8
Views: 326
Posted By stilllearning
Re: Need help removing number from an array

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: 677
Posted By stilllearning
Re: C++ Midterm Help Please!

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: 703
Posted By stilllearning
Re: *** glibc detected *** ./moo.exe: free(): invalid pointer: 0xb7f226ec ***

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: 703
Posted By stilllearning
Re: *** glibc detected *** ./moo.exe: free(): invalid pointer: 0xb7f226ec ***

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,006
Posted By stilllearning
Re: Master's Thesis - C++

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: 237
Posted By stilllearning
Re: Multimap in Class

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: 507
Posted By stilllearning
Re: Output Binary Search Tree to file help

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: 623
Posted By stilllearning
Re: getline from file

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, mySize,"...
Forum: C++ Oct 18th, 2008
Replies: 16
Views: 677
Posted By stilllearning
Re: C++ Midterm Help Please!

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: 703
Posted By stilllearning
Re: *** glibc detected *** ./moo.exe: free(): invalid pointer: 0xb7f226ec ***

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 declare...
Forum: C++ Oct 18th, 2008
Replies: 16
Views: 677
Posted By stilllearning
Re: C++ Midterm Help Please!

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: 703
Posted By stilllearning
Re: *** glibc detected *** ./moo.exe: free(): invalid pointer: 0xb7f226ec ***

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: 677
Posted By stilllearning
Re: C++ Midterm Help Please!

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 result in...
Forum: C++ Oct 18th, 2008
Replies: 8
Views: 325
Posted By stilllearning
Re: Help......

Add Code Tags Please !!!

And there is no #include<iostream.h>

its #include<iostream>
Forum: C++ Oct 18th, 2008
Replies: 12
Views: 615
Posted By stilllearning
Re: Having trouble with a loop.(For a class)

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,006
Posted By stilllearning
Re: Master's Thesis - C++

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: 341
Posted By stilllearning
Re: Tree traversal

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...
Forum: C++ Oct 18th, 2008
Replies: 16
Views: 677
Posted By stilllearning
Re: C++ Midterm Help Please!

You need to make an effort to write something .. you cannot honestly expect someone to solve your midterm exam for you.
Forum: C++ Oct 17th, 2008
Replies: 9
Views: 295
Posted By stilllearning
Re: Help with the goto thing.

not ... exaaactly !!

bool is a datatype .. so you cannot do bool == smthing

I don't know what you're trying to do, but here are some modifications.


bool test;
string input;
Forum: C++ Oct 17th, 2008
Replies: 5
Views: 333
Posted By stilllearning
Re: How do you export members to an exe from a custom DLL?

um .. could it be a spelling mistake on your part ?

its __declspec( dllimport )

not __declspec( dllimort )
Showing results 1 to 40 of 302

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8:16 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC