Forum: Java Oct 21st, 2009 |
| Replies: 4 Views: 407 Hi guys,
I am wondering how can I create a sorted linked list, without using Collection.sort(). Is there a way I can add element in a list in a sorted fashion? |
Forum: Java Oct 10th, 2009 |
| Replies: 7 Views: 254 yeah i did that, but instead of doing that, i wanna have iterator as its own class and pass the list as a reference to iterate through. |
Forum: Java Oct 10th, 2009 |
| Replies: 7 Views: 254 thanks, I have used listIterator before. What I am wondering is how would I implement it myself from scratch rather than one in java.util as an external class instead of having an inner iterator in... |
Forum: Java Oct 10th, 2009 |
| Replies: 7 Views: 254 how can u implement ext iterator? |
Forum: Java Oct 7th, 2009 |
| Replies: 7 Views: 254 Hey guys,
what are advantages of external and internal iterators? I understand that internal allows you to add and remove nodes as it has implicit reference to data in the outer class? So, why would... |
Forum: Assembly Apr 7th, 2009 |
| Replies: 1 Views: 296 Hey guys,
I am writing a program which reads in 2 floating point numbers from file and write the output to a file. The multiply part is very easy, but I can't seem to figure out how to write f loat... |
Forum: Assembly Mar 31st, 2009 |
| Replies: 0 Views: 701 Hi guys,
I know whene we shift left, MSB is moved into carry flag. Is it possible to store the value in carry flag into a variable? What i want to is, multiply the bit in carry flag by some number.... |
Forum: Assembly Mar 8th, 2009 |
| Replies: 0 Views: 952 Hi guys,
I am kinda confused on how to read integers from a file, named input. txt.
Here is what i have:
TITLE MASM Template (main.asm)
INCLUDE Irvine32.inc
.data
fileName db... |
Forum: Java Feb 12th, 2009 |
| Replies: 1 Views: 194 So, I am writing a program which reads inputs from a text file. The prgoram plants a plant at (x,y) location which is read from a file as PLANT 3,4 for example. It also puts the plant in flames from... |
Forum: Java Feb 10th, 2009 |
| Replies: 1 Views: 284 Hi Guys,
I am newbie to Java, I have take C++ at college. I want to create a 2 dimensional grid like on a graph paper with x-y axis. # of rows and columns will be specified by the user.
Need some... |
Forum: C++ May 5th, 2008 |
| Replies: 12 Views: 888 char ch = '—';
cout << static_cast<int>(ch);
The output is -105.
I tried isprint(), but it still gives an error. |
Forum: C++ May 4th, 2008 |
| Replies: 12 Views: 888 Is there a way to check if we've got one of the extended ASCII codes in C++? Because, I am reading from a file that contains '—', and because of that I get a "Debug assertion failed: (unsigned)(c+1)... |
Forum: C++ May 4th, 2008 |
| Replies: 12 Views: 888 thanks a lot man. it works now.
Just one more thing,
What are the not printable characters for C++?
One that I found is —. That is not minus(-). |
Forum: C++ May 4th, 2008 |
| Replies: 12 Views: 888 I haven't used vector before, but that looks easy using vectors. How would I compare say, "Alkesh" in the vector "theList". |
Forum: C++ May 4th, 2008 |
| Replies: 12 Views: 888 Ok. What I meant by getting the string twice is that, I am getting all the words 1st time just to know how many words are there. Then, 2nd time I am doing same thing but now I am actually storing... |
Forum: C++ May 4th, 2008 |
| Replies: 12 Views: 888 Hey Guys,
I want to read from a file. And store the string in a string class array. Number of strings in the file is unknown. How could this be done?
int n=0;
while(!inFile2.eof())
{... |
Forum: C++ May 2nd, 2008 |
| Replies: 3 Views: 1,748 ok, line count should work. But, words in our program aren't supposed to include non alphabetic characters. How would I go about that? |
Forum: C++ May 2nd, 2008 |
| Replies: 3 Views: 1,748 Hey Guys,
So, I am writing a program that reads in from a file, and prints the word and counts the number of lines in the document. Here is the function that is supposed to do the work. Every time I... |
Forum: C++ Apr 1st, 2008 |
| Replies: 10 Views: 914 yes, [0,100].
So, could I just modify it like the following?
std::random_shuffle ( a, a + 101 ); |
Forum: C++ Apr 1st, 2008 |
| Replies: 10 Views: 914 so, how would I go about modify random shuffle code that you wrote, for 5 random numbers and range [0,100]? |
Forum: C++ Apr 1st, 2008 |
| Replies: 10 Views: 914 would that work for larger range, if change n to 100? My goal is to create 5 random numbers from 1 to 100 without repetition. |
Forum: C++ Apr 1st, 2008 |
| Replies: 10 Views: 914 I ask because it works alright for larger range, but If I change the range to 0 to 4 instead of 0 to 20. I do get repetition. Is it possible to modify it a bit to get 100% no repetition? |
Forum: C++ Apr 1st, 2008 |
| Replies: 10 Views: 914 hey guys,
I want to create 6 different random numbers without repetitions and this what I have done. I just wanted to make sure if this logic makes sense.
for(int n=0 ; n<6 ; n++)
{... |
Forum: C++ Mar 20th, 2008 |
| Replies: 6 Views: 547 thanks man. It works now. Could you check if it everything is okay?
You see any places for improvement?
void profile::createProfile()
{
ProfileType *newProfile;
ProfileType *profilePtr;... |
Forum: C++ Mar 19th, 2008 |
| Replies: 6 Views: 547 yep, i had head == NULL instead of head = NULL.
thanks.
now, can i put the following code into another function say generateRandomProfile()?
newProfile->countryOfOrigin =... |
Forum: C++ Mar 19th, 2008 |
| Replies: 6 Views: 547 thanks man, got it working but now a new problem.
int profile::randomNumGenerator(int min, int max)
{
int random_integer;
int range=(max-min)+1;
random_integer =... |
Forum: C++ Mar 19th, 2008 |
| Replies: 6 Views: 547 why is this keep giving me same 2 numbers?
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdlib>
#include <windows.h>
using namespace std;
int generate(int,int); |