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

Try again -- your program is 100% wrong.

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

dreslough: The first function you posted doesn't produce that error on VC++ 2014. And the second can be simplified by removing the if-else statement

int Odd(int n)
{
   return (n%2!=0);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Welcome to Daniweb. Can't help you until we know what language you want to use. Then you should repost your question in the appropriate Software Forums forum.

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

1 In 4 Americans Thinks The Sun Goes Around The Earth, Survey Says

That's funny -- well maybe not (link). About 20% of American adults are functionally illiterate (link).

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

Lines 23 and 43 write text files, not binary files. If you want binary file then. You can't write binary then expect to read it as text, or vice versa.

os.write((void*)&os, sizeof(os));

and

os.read((void*)&os, sizeof(os));

On MS_Windows it's dangerous to attempt to write both text and binary into the same file because of the way '\n' is physically written to the hard drive -- it's actually written as two bytes, not one. *nix doesn't have that problem.

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

any windows installation will whine and complain about the smallest fixable issues like that.

I don't know what you are talking about. The only problem I've had in the past 8-10 years is when some hardware went bad, such as a bad memory stick or bad hard drive. Of course if you try to run Windows on a computer that has insufficient RAM or hard drive Windows is going to crash. But that's not the fault of the os -- it's your fault.

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

If it's Windows 8/8.1 then please read this article

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

Are you at work or at home when that happens? If you're at home why not just use Thunderbird? I'm guessing you don't have that option at work.

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

what thread are you talking about? You need to post a link to it.

Where is the start menu in Windows 7?

Are you kidding??? The Start menu is in the left most side of the toolbar. You can't miss it unless you're blind.

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

And how many bullets do those hand guns hold anyway? I've seen people shoot over 30 shots out of a 6-shooter gun without reloading.

And in True Lies, in one scene a gun bounces down a flight of outside stairs and shoots many of the bad buys.

Compare that with older movies, I watch 1967 film Head of the Night last night and I don't recall even seeing a gun.

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

sounds like you didn't create a console project so that Dev-C++ could generat the makefile.

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

How do I go about doing that?

Easy -- whenever a swap is needed swap the data that's within the two nodes instead of the pointers. If there are several data items in the nodes then I'd put the data in a structure and the structure object with the node. That will make swaping much easier.

struct data
{
   int x,y,z;
   char stuff[80];
};

struct node
{
   struct node* next;
   struct node* prev;
   struct data dat;
}

void swap(struct node* n1, struct node* n2)
{
   struct data temp;
   temp = n1->dat;
   n1->dat = n2->dat;
   n2->dat = temp;

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

I actually like tinstaafl's suggestion better than mine.

, whereas if it is declared in main() it cannot be.

Of course it can -- just pass the vector as a parameter to other functions. You'd have to do that no matter how it's declared.

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

Rather than attempting to swap link pointers it is a lot easier to swap the data and leave all the pointers alone.

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

I had a similar problem with a laptop, no screen or wifi driver.

FreeDOS is too heavy

How big a hard drive is in that computer? old DOS and FreeDOS don't dupport anything larger than about 2 TB (according to this link)

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

Tchaikovsky Violin Concerto, one of my favorates

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

Yes you can if you have the Windows SDK installed. I just successfully compiled your program with Code::Blocks and MinGW compiler after adding windows.h as the first include file.

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

While it is lagging I pinged Daniweb.com in a command prompt and got pretty quick responses.

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

I think it may be because there's a pointer inthe struct declaration,

Nope, it has nothing to do with that pointer, unless there is no memory allocated to the pointer.

The problem looks like Teams is not an array but a single instance of the structure. If you want Teams to be an array then

void searchAndTally(NBA_Team teams[], char team[], bool WL)

or

void searchAndTally(NBA_Team* teams, char team[], bool WL)

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

Yes, you can write your own, but since you mentioned xmove.exe I assumed you wanted MS-DOS. Be prepared to write assembly language.

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

If you are talking about MS-DOS 6.X and earlier, you don't "creat it". You get it from Microoft, assuming they still have it. There's also Dr DOS, which is MS-DOS like. But neither are supported any more because they're too old and nobody uses them. Here is a link that tells about the various versions and who write them.

You can still buy MS-DOS 6 from amazon.com for $70.00 USD

I prefer xmove in place of Cut & Paste

Windows File Explorer can do something like xmove.

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

what's the problem? How is array declared?

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

Please post the code you have written.

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

Where's the coded you have done? We are not going to write it for you.

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

Why is the vector of Student classes contained within the Student class? The vector should be declared in main(), not in the class itself

Then I'd take set_students() out of the class and make it a simple global function.

void set_students(vector<Student>& students);

int main()
{
    vector<Student> students;
    set_students(students);
}

what line 12 Score used for? Isn't the vector of scores the same thing?

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

It happened again to me just now.

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

Sometimes I click a menu and nothing happens for a long time. Other times I double post because I didn't think anything happened when I clicked the Submit button.

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

but I find it annoying when used in other situations

Especially when posting in any of these forums!

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

What is so magical about the digit 9, except turn it upside down and it becomes 6?

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

RIP -- she died recently at young age of 85. Those in my age group will remember her as the sweeet little curley haired girl in movies. She made a couple movies during here teenage years, but her movie career ended after that. After adulthood she became American Czechoslovakia. You might say she now rides on the Good Ship Lollypop.

Link for full details.

ernie.cordell commented: I hope she gets animal crackers there. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I already explained in the second paragraph how to tell the compiler where to find the lib files.

Is it right to say that as long as a library has proper header files and .lib files I can use it without any problems?

Generally, yes, as long as the lib was generated by the same compiler. AFAIK libs generated by GNU and Borland compilers are not compatible with Microsoft compilers.

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

How much c++ do you know? If you're a beginner then you need to study c++ for about a year (maybe longer) before attempting that program.

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

Go to Project --> <Project name> Properties (last menu item) --> Configuration Properties --> Linker --> Input. Then in the right pane, add the lib name in the first item Additional Dependencies.

Under Linker --> General, add the complete path to the lib in Additional Library Directories.

An alternative to the first paragraph above is to use a pragma in one of the *.c or *.cpp files

#pragma comment(lib, "libcurses.lib")

how to use it?

The same way you would use standard C libraries, include the *.h file in the *.c or *.cpp file that is going to use the functions in the library. If you're asking how to use PDCurses I think you will find tutorials if you just google for them.

A warning about using PDCurses -- it is a Windows port of a very very old *nix program which I believe even predates Windows 95. I used it on Unix in the mid 1980s. I don't know how well it works on modern Windows such as Windows 7/8/8.1.

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

New versions of Word can always save in older version formats, so it wasn't really necessary for everyone to upgrade unless there were other reasons to do so.

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

new is a c++, not a C. In C call malloc() or callc() to allocate memory, and free() to release it.

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

Not likely -- each new version of Word has it's own doc format which is incompatible with previous versions.

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

Do you have a windows repair disk? Did you make backup before you started screwing up your computer?

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

I'd recommend you learn VB.NET instead of a 15-20 year old compiler like VB 6.0. You can get VB.NET Express for free, just download it from Microsoft. There are lots of online tutorials for it too.
\
See this wiki article about history of vb.

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

hmm, I've Office 2010 installed on Win 8.1 and it runs just fine :)

I wanted to use Office 2012 but it wouldn't run on Windows 8. Never tried it on 8.1 because I already got Office 365.

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

We have Starbuks around here -- good product but much overpriced. I like Hills Bros double mocha cappuccino that I make at home.

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

You need to pass Number to assign() by reference, not by value so that assign() can change the structure that is declared in main().

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

I updated Nvidia drivers but that didn't fix the problem.

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

I'm running 64-bit Windows 8.1 on a PC with 16 Gig RAM and 8 cores. I've noticed a lot of lag, e.g. all action momentarily stops and when it starts back up the game character quickly speeds across the screen. At other times when I join a multi-user session where there is a lot of action my computer will just freeze up permently. In that case I can use Ctrl+Alt+Del to get to Task Manager and kill the Diablo III process.

Any ideas what might cause that problem? Is it more likely to be my video card or the Blizzard servers? I don't see that problem anywhere else or in any other program. I'm considering buying a better video card, but no point wasting money for it if that's not the problem.

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

Can you post the complete program? Are you setting the next pointer to NULL after a new node is allocated? If you don't do that then the rest of the program might attempt to dereference an invalid pointer.

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

Some compilers let you select the padding size, or no padding at all regardless of what the members of the structure consist of. If I'm writing a program to transfer structures to another system then I use no padding. The problem with that is accessing members may be a little slower.

#pragma pack(0) // no padding
struct foo
{
   char name[20];
   int x;
   int y;
}
#pragma pack() // return to default
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why would you want to do that with threading?? I don't see how threading would help solve the problem, except maybe for huge values of N. In that case you could split the problem up, create threads that calculate individual chuncks of data. For example, if N is 1 Million then you could split it up into 10 threads where each thread calculates the sum of products for 100 Thousand items. With that large of vectors you would run the risk of data overflow.

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

Move lines 3 and 4 down after that first if statement, between lines 10 and 11. If master is null (line 10) then line 4 will cause a seg fault.

In order to delete a node you have to keep track of the most recently visited node.

ALLOCPTR* current = master;
ALLOCPTR* prev = NULL;
while( current )
{
   if( current->id == job)
   {
      if( prev == NULL )
      {
         // delete head of the list
         prev = master;
         master = master->next;
         delete prev;
      }
      else
      {
          prev->next = current->next;
          delete prev;
      }
      break; // exit while loop
   }
   prev = current;
   current = current->next;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Open std::ifstream for input

int item_numnber[3];
float item_prices[3];
int item_qry[3];

In a loop, use ifstream's >> operator to read each field into it's array element.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
include "coduri functie.c"

Never, ever, for any reason include one *.c file in another. If your program uses more than one *.c file then compile each one separately and link them both together along with any libraries to create the final executable file. How to do that depends on the compiler you are using.