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

Are you trying to tell us that when the ink carterage runs out of ink we should just buy another printer a couple hundred dollars instead of a new ink carterage for $25.00USD?

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

I don't think anyone else can either :) VB.NET doesn't let you get down to the hardware level like C and Assembly do.

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

looks right, maybe you misspelled the file name(s)? Comment out the rename() function and check if the original file was removed after running your program.

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

Move line 17 down after the } on line 18 and outside that if statement. The line needs to be written whether the replacedment occurs or not.

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

What part(s) of that don't you understand?

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

Which tyre?"

LOL! You mean "which tire"

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

200 wpm??? Wow, you must be the fastest typist in the world! Barbara Blackburn only did 150 rpm for 50 minutes, although she hit 212 wpm at times.

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

Read this article to understand namespaces.

cout and cin replace printf() and scanf() respectively. Which is better? c++ program should generally use c++ conformant functions and classes. Although most C functions can be used in c++ programs, it is customary to use c++ functions whever possible. If you are more comfortable with C functions such as printf() then you might want to confinue using them while learning c++ language, then change over gradually to c++ cin function.

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

My guess is that procfile_read() is writing beyond the bounds of buffer parameter. Is buffer allocated enough memory to hold all those lines of text?

Also, the loop on line 21 should be <index, not <=index because the loop starts counting at 0 and the value of index is initially 1.

Each string in the buffer is NULL terminated, which means you can't use any of the string functions in string.h unless you iterate through the entire buffer with a pointer so that the pointer can increment past the '\0' byte to gain access to the next string. So if you just did printf("%s\n", buffer) only the first of several strings will be printed.

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

I know it's important to have good typing skill when I was growing up. The typing script is pretty neat. But nowadays does typing consider as a skill anymore to find employment?

If you want to be a secretary, yes. There are lots of other jobs too that require typing skills. For example I wouldn't hire a computer programmer who can't type faster than 40 wpm.

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

You need to post actual code, not something you just made up.

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

what have you read that is confusing? Post a link, then ask a question.

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

You mean Program A has a file open for reading, then Program B wants to write to that file? What I think you want is to synchronize two processes, see these google links

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

I think you are misunderstanding what that function is doing. It is only printing one word at a time, but it doesn't print a '\n' after each word. do this and each word should be on its own line.
cout << searchWords << '\n';

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

74 wpm is fantastic for hs freshman :) I was barly doing 40 wpm when I graduated hs in 1962, but then we didn't have computers, just old-fashioned manual typewriters similar to this one.

is it something you would ever refer back to or tell other people about?

Only if someone I know can't type and wanted a typing tutorial.

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

Yea, I used to post a lot until about a year ago.

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

Microsoft. I googled for it and found this link.

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

Happy birthday Dani :) :) My score was 55 WPM. Oh well, I don't type as much as I did 20+ years ago.When I was 30 I was doing about 100 wpm.

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

Reported.

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

I don't know, I installed the Express version but have not tried it out yet.

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

There are several ways to correct the problem: add using std::cout after the includes and before any functions, or on line 6 use std::cout

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

line 52: FDOM hasn't been initialized to anything, so it just contains some random value.

What compiler are you using? Learn to use your compiler's debugger so that you can easily find the mistakes in your program.

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

You mean you want to put a function in the output file? Why? Can't be done. You don't put executable code in the output file. Instead, you write a function that reads the output file and do whatever you need to do with the data.

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

try one of these round methods

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

I can't tell if that connects to a parallel or serial port. I don't see why it shouldn't work on Windows 7 as long as the hardware exists.

I found the below comment on MSDN (scroll to the bottom of the page)

Opening LPT Ports
Do not treat LPT ports as communication devices and specify OPEN_EXISTING as the dwCreationDisposition parameter. Doing so will cause the function to fail when called on Vista or a 2008 server to open an LPT port that is mapped to a network share. GetLastError() returns ERROR_FILE_NOT_FOUND.

Instead you can use the following parameters which I determined by using PROCMON.EXE from SysInternals to monitor calls to CreateFile() triggered by redirecting the output from DIR to a mapped LPT port eg. dir >lpt3

CreateFile("LPT3", GENERIC_WRITE | FILE_READ_ATTRIBUTES, FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);

The above has been tested on XP SP3, Windows Vista SP1 and Windows 2008 Terminal Server.

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

Anyone used this new compiler yet?

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

Your function total() is incomplete. After declaring section c you need to populate its members with totals from a + b then you can calculate the sum as you have coded it. The sum can't be calculated until no_boys and no_girls are known.

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

Which one, if any, of those you use will depend on how the cable is connected to the PC. Is it connected to LPT1, COM port, or USB? Most printers today are USB.

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

Probably, do I don't know how, never tried it.

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

when you shuffle the questions do you also shuffle the answers at the same time, that is, when a swap is needed you have to swap elements in both arrays so that the two arrays remain in the same order.

Oh well, I just answered a dead thread :)

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

No they are not the same. Read here and here.

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

Such diagnostics (which are not errors) are extremely useful

Don't count on it. It's best to remove all warnings in your code because most of the time they are actually errors, either in syntax or logic. On the otherhand, you can set the warning level of your compiler so high that it will emit warnings on all sorts of silly stupid things, even in header files that belong to the compiler!

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

VC++2012 (or VS2012, really dont know what people are calling it)

VC++2012 is a c/c++ compiler
VS2012 is a suite of compilers, includes VC++2012, VB.NET2012 and several others.

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

What version of Visual Studio are you using? M$ dropped support for c++ Windows
Forms in VS 2012.

textbox.Text = "something" will set the text in a textbox, read this link for all properties/methods.

So to make the calculation just convert the text in the textbox to an int, make calculations, convert result to a string, and assign back to the textbox. Since you are working with CLR/C++ I assume you already know how to to most of that.

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

how to check if the name is in between 1 and 25 characters. I know I need to use the >, <, || operators, but I can't remember how to compare a string. Any he

Just use std::string's length() method to find out how many characters are in the string. Just remember < is less than, > is greater than == is equal to, then there are <= and >=. Write that down on a piece of paper and keep it by your computer so that you can refere to it until you have it memorized.

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

Huh? I was just wondering if they sell valid copies of the software.

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

I came across this site a little while ago tha is selling Microsoft Visual Studio for ridiculously low prices. Illegal copies or valid?

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

Just take the original file name and append something to it

std::string name = "Hello";
std::string newname = name + "There";

ofstream out(newname.c_str());

Or, if you want to keep the same name just put the new file(s) in a different folder by appending the new path to the folder to the beginning of the file name.

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

Didn't you read the rest of this thread???? No one can help you if you don't know how to read.

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

if (temp.find(s_delete) != string::npos)

Should be ==, not !=. You want to write the string if the comparison is false.

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

you can do it in C, C++ or vb.net, use which ever language you already know and is able to call C language functions (which is most languages I know of). A more relevant question might be what gui libraries do you want to use. In c++ you could use wxWidgets, in C or C++ you could use OpenGL. It all depends on what you want to do with the gui.

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

The only way to replace one string with another string in a text file is to completely rewrite the file. Open the original text file for reading, open a temp file for writing. In a loop, read each line of the original file and rewrite it to the temp file, except write when you get to the line that needs to be replaced write the replacement string instead of the string read from the file. After all is done, close both files, delete the original file, then rename the temp file to the name of the original file.

If the file is small enough you could simplify the above by reading all the lines into memory at once, replace the line you want, then rewrite all the lines back to the original file.

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

how we protect our files from others to modify them through programming

You can't on MS-Windows. About the best you can do is encrypt the files, then when your program need to change the file decript it again. If you are running a version of MS-Windows that has NTFS file system then you can protect the folder in which the files are located, but not the files themselves.

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

I wouldn't call it a landslide, but Obama wan by quite a large margin. IMO one reason is all the millions of $$$ that Romney has hidden aware in offshore accounts that are untoughchable by US taxes. Another reason was his failure to disclose his tax returns.

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

I voted for Micky Mouse for President and Popeye as VP.

Ezzaral commented: Then you not only wasted your own time, you wasted other peoples' time. Congratulations on that. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

sell it on ebay?

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

The way I have done this in the past is to put a linked list of Citizens inside the District structure, something like below. Note that unless you were instructed to do otherwise you don't need both a CitizenNode and a Citizen structure, just one or the other.

struct Citizen
{
   // blabla

   struct Citizen* next;
 }

 struct District
 {
    struct District* next;
    struct Citizen* head; // <<<< linked list of Citizen structures
}

struct District* head = NULL; // <<< Linked list of District structures
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This are the examples of greateast inventions man has made

only time will tell. The pyrmids of Egypt are thousands of years old and still standing. Will our bridges last that long? Doubtful. Most of them won't las more than 40 years.