Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why don't you just write it yourself instead of begging us to do your homework for you. I charge $1,000.00 USD to do your homework.

Shft commented: Isn't the golden rule "Treat others as thou are liked to be treated"? +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

on line 40 the parameters to removename() are reversed, you have them backwards.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

eating fat-free and surgar-free cholote pudding :) I just ate a bowl of it :) :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 8 points to an address that was deleted in line 7. Once the memory is deleted you can't reference it again.

RonalBertogi commented: This explains well DaMaskMan2's question. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

i want the array(totalwin) t

You mean totalsum, there is no variable named totalwin

line 46 is saving the same value in totalsum three times. If you want each element of that array to contain the value of sum each time the loop repeats then you need a loop counter that only changes once each time the loop repeats. For example:

int main()
{
   int index = 0;
   ...
   ...
   totalsum[index] = num[0] + num[1];
   printf("Addition amounts to %d\n", totalsum[index]);
   index++;
   ...
   ...
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The people who post om Facebook, especially the ones I haven't seen for a long time.

especially my little brother's. he's just 6 months old.

I hope you still feel that way when he's 15 :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I quote you using '>', line break, and then I start typing; It still sees WHAT I AM TYPING as a quote. I dont know if this is a IE9/W7 bug....

Just use two line breaks instead of one. Problm solved.

Here is the thing: Users love the lipstick. They dont care if there is a pig behind it. Thats the developers problem.

LOL :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

but you're making yourself look a bit of an angry eric.

More like looking like a fool. He's the only one out of the 1,000,000 members who is complaining so hard about things. I think he is just trolling.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This is another intresting one: Hightlight text you want to quote, hit quote, and it gets quoted two times. Once again, the fine programmers of Daniweb...

Huh? When you hit Quote in the bibbon above the editor you get the following, which you need to replace with the text you want quoted. A little more awkward than it was in vBulletin, but its just easier to type the > character instead of hitting the Quote button then backing out the "Quoted Text Here" text.

> Quoted Text Here

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

it will if it's indented or tabbed at the beginning of the line.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh I see :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

the select all functionality doesn't work when you print the website out on a piece of paper and try do it

Huh? How can you do select all from a piece of paper???

noticed this and I tried to "Select All.........Copy" the textbox. ITS IMPOSSIBLE TO DO. Keyboard shortcuts

Blaim Microsoft, not DaniWeb.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I know only rand and srand but how to display these lucky/happy numbers and how to store 6dight numbers i array?

Simple: just an assignment statement. Below is an example.

int numbers[20];

for(int i = 0; i < 20; i++)
   numbers[i] = rand();


// now to display them
for(int i = 0; i < 20; i++)
    cout << numbers[i] << '\n';

If you want a six digit number
numbers[i] = (rand()%100000) + 100000;

In the above, % is the mod operator, which returns the remainder after division.

also dont know how to work with files

google is your friend when you want quick answer to a question. Read any of these google links.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

A forum should have the same expirence on a desktop platform or a mobile platform

With Windows 8 maybe that will happen, but for now it's impossible to have the same experience on both PC and mobile platform simply because mobile doesn't have the real-estate necessary to view DaniWeb like you do on PC. I tried it on a tablet -- very very difficult to do. Some web sites have a mobile version of the PC web site and the user experience are definitely different on the two. Maybe with Windows 8 and beyond that will change so that the experience will be identical on both. But for now, that isn't possible.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm happy I don't have to worry about exams any more :) :) :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What version of MS-Windows do you have? Using Turbo C is a little like putting a Model T engine made in 1890 into a 2012 automobile. You might try running Turbo C in DosBox

Musa_Jutt commented: thankx +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have discovered that the problem I had may have been caused by incompatible anti-virus program, not Windows 8.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In the read function, the loop should look like below. If that doesn't fix the problem then I suspect the problem is in the BOOK class constructor. You need to post it.

while( file>>ID>>bookName>>author>>book_type>>copies>>price>>status)
{

}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The ONE word solution certainly would NOT be "religion" because that's been the cause of most of the world's violance.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your program worked ok using VC++ 2012 Express. I just created a directory structure like the one in your program and copied a text file named sample.txt. That tells me your problem is either your compiler or the location of the file.

Move sample.txt to c:\ and see if your program works with that. It's possible the path is too long for your compiler or the compiler doesn't like the ++ in the folder name.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

So what's your problem? We do not do homework for you, you post the code you have written and ask specific questions. Just posting your assignment does nothing.

zachattack05 commented: So true +5
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Sart here

int main()
{

   // put your code here

}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

click the "Edit Profile" link in the purple ribbon at the top of the screen, then there is a Password edit box next to your email address, which appears at the top of that screen.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

sql databases can generate the numbers for you, just make one of the columns auto increment.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The whole purpose of critical sections is to block out other threads while inside the code bounded by critical section. If other threads were allowed in then the critical section concept would be useless. Critical sections are pieces of code that are shared among threads -- I see no such thing in the code you posted.

What you are looking for is implementation of a mutex. Mutex's, not critical sections, are used to synchronize access to a single object among two or more threads. main() should create the mutex and each thread access it. If you are compiling for MS-Windows then you need to call the win32 api CreateMutex()

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

We will HELP, but we won't write it for you. Post some code to show us what effort you have made to write the program, then ask specific question(s).

Start out by creating a character array of 16 questions and their answers. Then in main() create a loop that asks each question, waits for a response, then check the user's answer against the correct answer. You will need two int counters, one to count the number of correct answers and the other to count the number of incorrect answers.

Don't attempt to write all this at one time. Code a little bit, compile, correct errors, then repeat. Many new programmers make the mistake of attempting to write everything all at one time, which can lead to millions of error messages and a lot of confusion. So take it in small steps, even professional programmers do that when they write large programs.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

put it in a frame at a slight angle and call it Art...

Good idea -- I'll think about that. I've heard about artists who put human feces in a jar and sold it as art for several thousands of $$$.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Resources may be part of it, but VC++ 2012 Express is also slow to start. My guess is the way it reads the project startup file(s).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It's all in the file extension. *.c files are read as C programs.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes, I like it, with the exception that Microsoft dropped support for Windows Forms in their CLR/C++ templates. Not sure if the compiler will compile it or not if you have a WF program started by an earlier version of the compiler/IDE.

Unfortunately I think it's a little slow starting up; they need to work on that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

your program is missing three parts, not just one as shown in the comment on line 15.
1. Before line 13 display the value of r and the '!=' so that if r == 1 it woould display "1!=".
2. Inside the loop at line 15 display the value of c and if c != r then also display 'X'.
3. The third piece is after the end of the loop, between lines 16 and 17, you need to display the value of the computed factorial.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you don't need two nested loops, just one will do that counts backwards from 's' to 1. Inside the loop you just need to print the value of the loop counter and 'X' as well as calculate the factorial of s.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Dev-C++ is not a compiler -- its only an IDE. MinGW is a compiler, VC++ is a compiler and an IDE as is Turbo C++.Which is best for MS-Windows? Microsoft VC++ of course because that is what Microsoft uses to develop MS-Windows. It's also best because of many other reasons, such as debugging, code completion, and project management to name just three.

Which is best for beginners to learn is quite another question. VC++ is difficult to learn because of its many features. I would say Code::Blocks with MinGW compiler is better for beginners. Dev-C++ might be a nice IDE but the version of MinGW that comes with it is not up-to-date, but for beginners that too many not be very relevant because most beginners won't be using the new features added by c++11 standards.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Theoritically, yes, but no one has thousands of rep points. Look at my profile, it has one of the hightest on DaniWeb yet I only affect +14 or -3 points, depending on whether I vote up or down and leave a comment. The reason for such a small amount is because we thought I and others like me should not have to power to completely destroy someone's rep with just one vote. Before Dani changed the system a year or so ago I refused to downvote anyone because he/she would never be able to recover from it. Dani implemented a rep system that is today a lot more fair to everyone than it was two years ago.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

most rep points are produced by members voting a post with the up or down arrow and leaving a comment. No comment means no points given. Other rep points are given by the system after certain intervals of posting, new members are given 10 points. The amount of points you can receive depends on the rep points that the member himself/herself has acquired. If you want to find that out just click the member's avatar and a screen will appear that will give you that information as well as a lot of other info about the member.

deceptikon commented: Good answers. :) +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Put $5,000USD in my PayPal account and I'l do your homework for you. Otherwise, if you don't want to do that, I guess you'll just have to solve it yourself.

How do you get 32, 42 and 52 from that data?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

strcpy() is wrong because it takes two character arrays as arguments, not two single characters

Your second example on line 17 is correct way to do it. But you didn't really say what the expected output should be so I can't say whether its right or wrong.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Same problem reported here yesterday

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Is creature.h spelled "creature.h" or "creatures.h" -- your program contains both spellings.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

getline() is a c++ function not useful in C programs. As for fgets() being unreliable, it isn't if you use it correctly.

If you know bigDaddy is big enough why not just use that as the parameter to fgets() instead of buf? In any event, the program needs to execute line 8 regardless of whether the '\n' exists or not because otherwise bigDaddy won't contain all the data.

It might be better to make bigDaddy a pointer so that memory can be allocated to it as needed. In the loop just reallocate bigDaddy to hold the curerent string plus the new string.

char* bigDaddy = NULL;
char buf[BUFSIZE];
char* ptr;
while( fgets(buf,sizeof(buf),fp) )
{
    bigDaddy = realloc(bigDaddy, strlen(bugDaddy)+strlen(buf)+1);
    strcat(bigDaddy, buf);
    if( (ptr = strrchr(bigDaddy,'\n')) != NULL)
    {
        *ptr = '\0';
        break;
    }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Since code always contain line numbers (at least in the C/C++ forums it does) I see no reason to quote it, just refer to the line number(s) should be sufficient.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It will also depend on your network connection speed. I'm also using Chrome, my rep graph is pretty large, and my profile page loads with no problems. Maybe there should be an option to turn off that graph so that people with slow connections don't have to wait so long.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

So you can do something like this

Or just use sprintf()

char filename[40];
sprintf(filename,"03/%s.txt", sn);
// filename = "03/1234.txt"
dx9_programmer commented: haha yes of course +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You won't find anyone here who will write your program for you, so you might as well try to do it then post the questions you have.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Could be this problem

triumphost commented: Similar +6
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

don't use a macro to declare a variable -- just too confusing.

Does the second buff overwrite the first one

Depends on where the first one is declared. If its in the same block enclosed with { and } then there will be a compiler error for duplicate symbol. If the first one is somewhere else then the compiler may produce just a warning or nothing at all. In that case the second declaration will override the first.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Hummm -- I think Dani needs to sue Microsoft for about $10 Billion because DaniWeb had that color scheme first.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I posted sudo code that accomplishes that. And DavidB posted a complete program. What more do you want? Maybe you just don't understand what we posted. Put David's program into your compiler's editor, compile it, then run it to find out for yourself what it does. Then compare the program you posted with David's.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why use an array? Just sum the numbers as they are entered then print the result when finished, no need to keep them.

start of loop
   enter a number
   if number less than 0?  if yes then exit the loop
   sum = sum + value of number entered
end of loop
print value of sum
NathanOliver commented: Thanks. I over thought that +10