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

Please read the rules and information in my signature. We do not do your homework.

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

No I don't .. and I sure didn't mean for that smiley face to show up either. I entered a simple colon-end parens ..

Before you press the Submit Reply button scroll down the page and you will find a checkbox under Miscellaneous Options to disable smilies in the post.

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

I saw on TV just a few minutes ago that the Queen (UK) has her own website but they didn't give the URL. I guessed www.royalfamily.uk but that wasn't it. Anyone know what it is ?

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

Nice imates. Its amazing (to me anyway) how much talent some people have.

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

my new year's resolution is to see the next new year in :)

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

warning: implicit declaration of function ‘get_current_dir_name’

It's defined in <unistd.h> when _GNU_SOURCE is defined in the preprocessor.


This is not the solution.

you mean there is a function in unistd.h named get_current_dir_name? Standard library function names are not normally so long. But, if the function is declared in that header file then you are right.

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

There's probably at least a couple ways to do it.
1) read the entire master file into an array of structures or classes, then for each row in the transaction file search the array for the master record. If the master record is found then update it. If no master record then add one. When all done reading the transaction file write the master file array back to file.

2) similar to above but the master file is assumed to be too large to fit in memory all at one time. Afterall there could be thousands of employees. First, create a binary version of the master file -- read each record in the original text file into a fixed-length structure and write it out to a temp file in binary form. This will give you a file with fixed length records which can be updated without rewriting the entire file. When that is done start reading the transaction file. For each record in the transaction file search the temp master file for the matching id. When found, update the master structure and rewrite the changes back to the temp file. After that is all done you can rewrite the original master file with the information from the temp binary file.

jbennet commented: :) +23
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think you misunderstood the other poster.

It was a joke :)

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

So where is get_current_dir_name() defined? Functions must always be declared before they can be used. Since the C compiler does not know any better it will assume the fucntions returns an int, and that is not what the fprintf() statement expects as the parameter. The solution is to prototype it near the top of the program, somewhere above main().

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

Inline solution below

int __inline count_digits(int n)
{
   // blabla
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In Face::addPoint() you should verify that location < the allocation size of numberOfPoints.

Actually, you don't need data.cpp at all. Just use inline code in the header files.

Can't really help you much more without example data file to work with.

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

>>I want to know how ti make it show a playng card instead of the image.
But ... a playing card IS an image, its just a specific kind of image. Probably all you have to do is create a bitmap of a card then use it in that program (and No, I did not bother to read all the code you posted).

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

what does fstream have to do with calculating the area of a triangle? The area is a mathametical operation, not a file operation.

How would you find the area of a triangle using pencil & paper? Then do it the same way in a C or C++ program.

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

>>Is there a short way to determine how many digits are in an integer
In a loop keep dividing it by 10 until the result is 0

while(n > 0)
{
   n  /= 10;
   count++;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> I think face-sucking in public is offensive
I agree -- a really long kiss in public is offensive, but short smack on the lips is not. And the standards of conduct among gays is (or should be) the same as straights.

But what offends me the most is heavy cursing, especialy the F word. I will not watch movies or stand-up comedians that use a lot of cursing or that include long hot sex scenes.

Another category: public drunkenness. They are pathatic people, and often drunks get mean. Drinking alcohol in moderation is ok for most people, but some don't know how or when to stop.

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

>>I downloaded Visual C++ 2005 Expres Edition ,why i can't make a project ,what to do reslove that?

To create a project: select menu File -->New -->Project, then set Project Type to Win32 and Visual Studio Installed Templates to Win32 Console Application. At the bottom of the screen enter the project name and select the desired location. Finally on that window press the Ok button.

The next window to appear is the Application Settings window. Select Console Application and press the Finish button.

All done.

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

I am doing it in windows Xp and I am unable to run that code.

Yes, I told you so :)

Plese tell me a simple program in DEV CPP Ide where I can send and recieve the data through the serial port.

Simple? There is no such thing. Read through the information in the links I provided in my previous post. You will have to do quite a but of studying.

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

How to send/receive on serial port is operating system dependent. The code you posted was written for MS-DOS and Dev-C++ only compiles for MS-Windows. You can not use any of the code you posted with that compiler. So you might as well just toss it away and use win32 api functions. Start by reading MSDN for CreateFile function to open the serial port, then scroll down the page until you see Communications Resources.

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

Your problem might be this:

Also, make sure you compile the program for Release and not for debug.

>>The way I am compiling them is by clicking the green arrow (But, the mouse tip says its called "Start Debugging"
No. To compile select menu Build --> Build Solution. Or hit <F7>

Also just under the File menu you see a row of buttons, and to the right of that rows you see a two combo boxs, If one of them says Debug then change it to Release

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

Yes == see these code snippets which build directory trees in memory for both *nix and MS-Windows.

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

. is the MObo an ATx board?

No -- its a K8N-E Delux Asus

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

>>i am feeling dumb
Don't feel too bad -- we all go through that learning curve.

Please post your most recent code. You probably need to add a line at the bottom of main() just before return to make it wait for you to see the output.

int main()
{
...
   cin.get(); // get key 
   return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

compile was successful with 0 errors

Great going! :) Now you should see the correct output on the screen.

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

>>can any one tell me where am i wrong plz
Yes, you failed to use code tags when you posted here :)

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
  std::string line;
  ifstream myfile("C:\test.txt");
  // now read the first line of the file
  getline(myfile, line);
  // display the line on the screen
  cout << line << "\n";
  // make the program wait for keypress so you can see the above output
  cin.get();
  return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Is there an easyier way of doing what im trying to achieve?
You never said what you are trying to achieve other than creating directories. How much easier do you want it to get anyway, just call mkdir() for each of the directory names.

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

>>duplicate symbol _main
you are getting a blank sceen because there were compile errors. You can not execute the program until after your compiler produces 0 errors and links successfully.

If you get that error message then you are not posting your entire program. You can have only one main() function in a program -- actually that really applies to every function that have the same list of parameters.

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

>>Quotes are generally used to reference headers that require an absolute path or headers in your project
Most (but not all) compilers use angle brackets to reference header files that are in the compiler's known directories, such as the compiler's include directory and double quotes are used to reference all other header files, such as those you write yourself and are in your project's source code directory. On the otherhand, I have used compilers that treat angle brackets and quotes the same.

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

>>Have I got this right so far?
Yup -- that's all there is to it. Hopefully you are not writing a multi-threaded program :)

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

Also check out the boost filesystem functions

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

I think it would help everyone to understand if you would provide some examples. Do you need functions to display information in different languages, such as English, German, French etc.? You create a language DLL for each language you want to support then install the desired language dll when you install the rest of the program. I'm certain you must have seen this before when you try to install something that other people have written.

Jishnu commented: Thanks :) +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

pretty simple really, just call mkdir() for each directory in the tree.

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

Get yourself an Introduction To c++ book and start reading/studying from page #1. If you don't know how to do simple file stuff then there is no way you will be able to encode a file. Read the Read Me threads at the top of this board for a wealth of information you need to learn.

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

If you don't want an icon on your desktop then just click once on it to highlit it then press the <Del> key or drag it to the trashbin. Of course, this is after Vista has been installed and ready to go. If you want to add one then use Explorer to find the program, right click on it, select Send To from the menu and then Desktop.

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

This program works for me, but I don't know if it will read those MAC files or not.

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

Sorry to resurrect this old thread but I just found the solution a little while ago. When I installed Visual Studio 2008 it installed .NET framework 3.2 and now my computer can reboot the way it should. I tried to install something else earlier this morning and the installer said I needed to install .NET framework on my computer.

I thought Windows Vista installed .NET framework by default during installation, but apparently not.

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

I suppose you could call Microsoft Techn Support for $100.00 USD/hour (or so) to find out where to get the information. Myself, I have no idea where to get it. I assume you have already tried these links.

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

Oh so you want a free client that access the server, that's different. Just write your own, not a big thing to do -- well I guess it could be if you don't have any experience in SQL query language or wrinting programs that access databases.

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

Read the Read Me threads at the beginning of this board because they contain a wealth of information about books, compilers and other related resources.

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

I don't use LoadLibrary() for most DLLs that I write. Instead, I just use __dllimport and prototype it in the *.c or *.cpp application program, then link with the *.lib file that the compiler generated when the DLL was compiled and linked. But of course if you don't have a *.lib file then this method will not work.

// prototype the function that is in the DLL
void __declspec (dlimport) function1();

int main()
{
     function1(); // call the function in the DLL

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

If you want to pass the name of the file to your program at runtime then just add the filename on the command line when you run your program. c:\myprog.exe file1.txt <Enter> Then your program can use the arguments to main() to get the filename

int main(int argc, char* argv[])
{
   char* filename = 0;
    if( argc > 1)
        filename = argv[1];
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

And another term I've seen floating around is "software engineer".

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

well I was asking for MS (Microsoft SQL Server) alternate and not mysql

mysql is an alternative to MS SQL Server. If you don't think so then what do you consider an alternative ? Sybase also has SQL servers. but they are not free.

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

>> char filename, filename2, word[20];
You are attempting to tread char as if it were std::string. My suggestion is to get rid of those c-style character arrays and use the easier-to-use std::string instead

std::string filename, filename2, word;

...
      cout << "Enter your output filename";
      getline(filename2,cin);//allow filename to contain spaces
      ofstream out(filename2.c_str());
      while( fin >> word)
      {
          if( word == "COMPUTER" || word == "COMPUTERS")
              fout << word;

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

>Example:
Now you only have to port it to C.

Oops! I used iostreams by mistake.


By the way. I am having troubles making it work in Dev C++.
As a C++ compilation I get this error: `GetConsoleWindow' undeclared (first use this function)

After poking around Dev-C++\include\DDK I see that it is missing quite a few files. You will probably have to download the Windows Platform SDK from M$ and use that instead of the package that is supplied with Dev-C++. GetConsoleWindow() is defined in wincon.h which is not part of Dev-C++ win32 package.

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

This morning I woke myself and my wife up laughing at some cartoon character. I don't recall the details but it must have been pretty funny.

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

Winter of 1982 we got over 4 feet of it in one snowstorm! We were snowed in for 3 days before someone dug us out. Fortunately (or unfortunately depending how to look at it) I just lived across the street from my job so I had to walk to work in 4 ft snowbanks. The clearners brought out the huge dump trucks and dozers to shovel us out and dumped the snow in a couple nearby football parks. The snow was about two stories high when they finished. Looked like we made our own iceberg :)

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

Of course the user could always use Notepad to view the file.

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

Hmm, I think I'll go write a nap( ) function, that puts the program down for some random amount of time, waiting for delivery of milk and cookies.
Val

Great idea! I'l join you :)

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

see instructions for mailx command.