Search Results

Showing results 1 to 40 of 149
Search took 0.02 seconds.
Search: Posts Made By: Sky Diploma
Forum: C++ 7 Days Ago
Replies: 4
Views: 185
Posted By Sky Diploma
you will need to set up the variable values for numerator and the denominator using 2 different for loops

and then compute numerator/denominator.. after which you send it up.
Forum: C++ Oct 31st, 2009
Replies: 9
Views: 357
Posted By Sky Diploma
apart from what A.D said, to get a little technical, you may want to try the peek() function. Check if that character is an alphabet or a number. if its a number . take in the number with the >>...
Forum: C++ Oct 31st, 2009
Replies: 11
Views: 494
Posted By Sky Diploma
Or another thing you can do is to call the grade function from Average ().
Forum: C++ Oct 29th, 2009
Replies: 8
Views: 539
Posted By Sky Diploma
This is perfectly right !! Nice, work figuring out the suggestion of FirstPerson .
Forum: C++ Oct 27th, 2009
Replies: 6
Views: 257
Posted By Sky Diploma
Yes, its a mere notational advantage .
This applies to both for loops and if statements.

If the curly braces { } are absent. the loop only executes the next line.


for(j=2; j<=i/2; j++)
...
Forum: C++ Oct 27th, 2009
Replies: 6
Views: 257
Posted By Sky Diploma
Well this program is not as complex as it seems to be.

for(i=1; i<=100; i++)
The first for loop runs from 0 to 100, and runs a test for checking whether its prime or not.

Then in the...
Forum: C++ Oct 27th, 2009
Replies: 5
Views: 277
Posted By Sky Diploma
I wonder if it is compulsary to use new to allocate variable space. Since it is only one. Why dont you just declare a variable. That way you will not need to worry about deleting. as the Destructor...
Forum: C++ Oct 21st, 2009
Replies: 3
Views: 327
Posted By Sky Diploma
Remove the declaration of the variable int i=0; from line 14 and place it in between 33-34 or 34-35.

The problem is that the scope of the variable which retains the value of 11 after the first...
Forum: C++ Oct 6th, 2009
Replies: 21
Views: 694
Posted By Sky Diploma
Well its pretty unclear for me to understand this, Please Post down the Input , Desired Output and Current Output. That way it would be easy.
Forum: C++ Oct 5th, 2009
Replies: 5
Views: 230
Posted By Sky Diploma
Well, we appreciate that you are trying to put-in effort. But We would require you to make an attempt at cracking the solution yourself. Then when you have an attempt, we could then come in and get...
Forum: C++ Oct 5th, 2009
Replies: 21
Views: 694
Posted By Sky Diploma
Shoudnt Line 12 be

the reverse newNode->info=i->info;

And could you explain what line 15 is doing?
Forum: C++ Oct 5th, 2009
Replies: 5
Views: 230
Posted By Sky Diploma
Firstly you are looking at different operations.

1) Maintain A Database, That's pretty much done, when you have a excel spreadsheet which you can later convert into CSV (Comma separated Value )...
Forum: C++ Oct 5th, 2009
Replies: 21
Views: 694
Posted By Sky Diploma
If both are of type string, you could just use the "=" operator and completely avoid strcpy.
Forum: C++ Oct 5th, 2009
Replies: 21
Views: 694
Posted By Sky Diploma
I dont understand why cant you use.


tempword=i->info;
Forum: C++ Oct 5th, 2009
Replies: 21
Views: 694
Posted By Sky Diploma
for(int i = first; i->link != NULL; i = i->link)
Check Line 4 in the code in your post. it consists the above code.You have declared variable i to be of type int then you use the -> operator ....
Forum: C++ Oct 5th, 2009
Replies: 4
Views: 298
Posted By Sky Diploma
Well in your question. You said that you need to use arrays. But You are not using any in your program. The best approach would be to analyse the question and think how you can use a index to get the...
Forum: C++ Oct 2nd, 2009
Replies: 4
Views: 280
Posted By Sky Diploma
Yes, Btw, Dont forget deleting each one of the dynamic pointers . Before you delete the pointer to pointer.
And yea, Loops could assign values.
Another solution would be to use vectors.
Forum: C++ Oct 2nd, 2009
Replies: 4
Views: 280
Posted By Sky Diploma
Well Dynamic 2D arrays take a little more complexity.This is mainly because when you declare something like this


int *p;
p= new int [2][2];

What you are trying to do is assigning a pointer...
Forum: C++ Sep 16th, 2009
Replies: 7
Views: 496
Posted By Sky Diploma
It is not that you are creating 5 strings of size 35, But actually Creating an 2-d array of 5 rows and 35 columns.

The size of the string is not constant and can extend as much as possible ,until...
Forum: C++ Sep 13th, 2009
Replies: 36
Views: 1,423
Posted By Sky Diploma
The main Problem in your code is that it replaces the letter "b" with the letter in UNICODE represented as "001A", which is the key to break the execution of the program.
Forum: C++ Sep 12th, 2009
Replies: 6
Views: 338
Posted By Sky Diploma
Yes, If you use the namespace. there is no need to inline the std::
Forum: C++ Sep 8th, 2009
Replies: 9
Views: 360
Posted By Sky Diploma
Hehe, I guess SALEM's Right As Always ;)

Btw, For the OP, Here's a Tip that would help you out.

Check out how "Pointers work." If you figure that out, I guess you will find that its...
Forum: C++ Sep 8th, 2009
Replies: 16
Views: 787
Posted By Sky Diploma
>>what id i swap the num-- to --num what will that do??

-- is the decrement operator.
The Basic function of the Decrement operator is to decrease the value of the variable by 1.Thats pretty...
Forum: C++ Sep 8th, 2009
Replies: 6
Views: 338
Posted By Sky Diploma
http://www.cplusplus.com/reference/clibrary/cstdio/printf/

This is a complete explaination of the printf function . you will notice that %x or %X is denoted to show the hexadecimal notation.
...
Forum: C++ Sep 2nd, 2009
Replies: 2
Views: 659
Posted By Sky Diploma
The function toupper takes a character argument and returns a character. so you cant assign a string and expect to get back the string itself.

You will have to replace every letter in the string...
Forum: C++ Aug 18th, 2009
Replies: 15
Views: 496
Posted By Sky Diploma
I think it would work if you could change this

a->pVar=static_cast<int*>(passedVar);

to static_cast<int*>(a->pVar)=static_cast<int*>(passedVar);

The error you get is because you are...
Forum: C++ Aug 18th, 2009
Replies: 3
Views: 274
Posted By Sky Diploma
Yes, this is prettymuch the best way to do it, However if you could use the string library i guess it would be pretty easy with the use of + Operator.
Forum: C++ Aug 18th, 2009
Replies: 7
Views: 586
Posted By Sky Diploma
Well, Its quite simple, Use the same formula that you have in the existing code, But just change all the instances of '5' with a variable.

For Eg:

for(i=1; i<=5; i++)
This could be...
Forum: C++ Aug 14th, 2009
Replies: 12
Views: 592
Posted By Sky Diploma
That was just an attempt to show that there is an exception to default arguments..
Forum: C++ Aug 14th, 2009
Replies: 1
Views: 209
Posted By Sky Diploma
inpa >>(name)>> (visit_duration) >> doctor;
your doctor class does not have a >> operator overloaded, hence the compiler places that error.

You can either define the operator, or change the value...
Forum: C++ Aug 14th, 2009
Replies: 12
Views: 592
Posted By Sky Diploma
Not necessaryly.

Well another alternative would be to give default values to your arguments for eg:


void funcname(int a, int b=0, int c=0);


Now i can just call the function in these 3...
Forum: C++ Aug 8th, 2009
Replies: 18
Solved: Employee Class
Views: 1,024
Posted By Sky Diploma
Are you getting an error?

What is the name of the file in which the class declaration is stored?
Forum: C++ Aug 8th, 2009
Replies: 18
Solved: Employee Class
Views: 1,024
Posted By Sky Diploma
Well, You have misunderstood the basic concept of a class


Employee Name[3] ={ "Susan Meyer", "Mark Jones", "Joy Rogers"};
Employee Idnumber[3] ={ 47899, 39119,81774};
Employee Department[3]...
Forum: C++ Aug 2nd, 2009
Replies: 3
Views: 339
Posted By Sky Diploma
Since you have already tried some methods. Just post down your existing code and maybe We can find where the problem is.

Or You can always use google :)
Forum: C++ Jul 31st, 2009
Replies: 5
Views: 348
Posted By Sky Diploma
It would become quite complex in testing a particular sudoku,for validity without using arrays.So i guess if you are allowed to use string, it would be the appropriate type, though it involves...
Forum: C++ Jul 29th, 2009
Replies: 4
Views: 215
Posted By Sky Diploma
Well I cant..........But I guess you can help yourself with some basics.
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html
Forum: C++ Jul 29th, 2009
Replies: 4
Views: 215
Posted By Sky Diploma
I think this is an idea of what you actually need...
http://lmgtfy.com/?q=raw+sockets
Forum: C++ Jul 16th, 2009
Replies: 4
Views: 352
Posted By Sky Diploma
You can use stringstreams.

Here is the main algorithm which you can work on.

1 ) Get your number into a string.
2 ) replace the ',' with '.'
3 ) Then you can always put the number into the...
Forum: C++ Jul 15th, 2009
Replies: 2
Views: 249
Posted By Sky Diploma
If that is what you want, You are getting the right thing.

And where as this is considered.

INT x,y=6;

try the standard C++ int type


int x,y=6;
Forum: C++ Jul 13th, 2009
Replies: 8
Views: 618
Posted By Sky Diploma
Use a do while loop instead of the while loop and then you can add the getline inside the loop ,


do {
//getline here.
//other code here.
}while (!fsFile.eof());

So you read the file until...
Showing results 1 to 40 of 149

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC