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

lol I am not that active now (and im early 20's)

Get away from that computer and move your a** to avoid problems in later life :) Spend at least an hour a day, 5 days a week doing good physical exertises.

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

hi..the compiler that you mean is it the program?
now i am using visual c++6. The compiler should be inside the program right? thanks..

Yes, when many people speak of "compiler" they also mean the IDE.

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

If you have VC++ 6.0 then you can use MFC. The best place I know of to get MFC code is here

MFC is not easy to use and you need to be comfortable with c++. There's about a year's learning curve to learn MFC pretty well. If you go to that site and enter "Plotting" in their search engine you will get a list of sever complete programs they have on file.

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

teach exercise classes at the W

Just saw this on TV local news. What an inspiration -- hope I'm that active at her age :)

The instructor is Louise Larsen and she's 90 years old!

"She loves teaching. She loves fitness," says
Kirkwood YMCA manager Diane Wagner. "She just has so much exuberance for everything that she does."

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

Unfortunately the more difficult ones I struggle to read, lol so it's a balance really

*

I agree, Sometimes I get frustrated at not being able to successfully type the right characters and just leave with web site. Result: they just lost a member.

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

lines 8 and 16: remove the semicolon on those two lines. I assume you are attempting to write functions there ??? If that is correct then you can not nest functions inside other functions like that -- see main() on line 3. Move the code for those functions outside main(). Or you could just finish up main() before starting those functions. Either way, what you did won't work.

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

I suck at text sarcasm.

Mee too :)

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

I doubt you since you are a n00b. ^
|:)

Low post count says nothing about knowledge.

Also see this thread.

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

This isn't really a VB question but a system administration question. Remove all those programs from the Start menu and any shortcuts that may be on the window. Its not completly foolproof but might reduce the chances that those products are accessible to the normal computer user.

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

use const int values to define the array dimensions then use those variables in the code. Or you could do something like this:

int rows = sizeof( example ) / sizeof( example[0] );
int cols = sizeof( example[0] ) / sizeof(float);
for(k=0;k< rows ;k++) // line 24
{

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

You need to create a new mat object inside that function, add the two matrixes parameters together then return it. I think this is a good candidate to use the throw statement if the two matrices can not be added.

mat operator + (mat &m1,mat &m2)  // mat is a class for matrices
{
	int r1=m1.getrow(); // getrow returns number of rows
	int r2=m2.getrow();
	int c1=m1.getcol(); //getcol returns number of cols
	int c2=m2.getcol();
mat m3(r1,c1); // <<<<<<<
	if((r1!=r2)||(c1!=c2))
	{
		cout<<endl<<"Addition not possible.";
throw; // <<<<  ?????		
	}
	else
	{
		for(int i=0;i<r1;i++)
		{
			for(int j=0;j<c1;j++)
			{
				m3.get_element(i,j,m1.get_element()+m2.get_element());
			}
		}
	}
  return m3; // <<<<<<<<<<<<<<<<<< here
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I wish I'd known about that Usability Studies link when I bought Vista os because I would have like to have given M$ a piece of my mind about that stupid packaging too. It took awhile for me to figure out how to open the damed thing too. Its terrible.

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

Don't be in such a damed big hurry! Afterall you only made your post 25 minutes ago. Give it at least a couple days for people to read your post and respond (if they want to).

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

>>strcmp(chartryname, charname)==0 && (chartrypassword, charpassword) ==0

Like this: if( (strcmp(chartryname, charname)==0) && (strcmp(chartrypassword, charpassword) ==0) ){

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

The link you posted is used by the Microsoft Foundation Class (MFC) which is a set of c++ functions that wrap the win32 api functions. In order for that program to be useful to you, you must have one of the Microsoft compilers that supports MFC and those compilers are not free (about $900 USD or more depending on the version you want).

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

Tackle this problem one small step at a time, don't get overwhelmed and attempt to do it all at once. Start out very simply, with int main() and create a 2d char array that represents the rows and columns. Get that to compile without errors and then move on to the next step. Add a menu that asks if you want to reserve seats, cancel reservations, or quit. Then write a function to implement each of those menu items.

I hope you gave yourself plenty of time to do this program because it might take you several days, depending on how well you know the c++ language.

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

>>Also, I have no doubt there are better ways to emulate getch(), if you know of one please point me in the right direction.

Its called curses.

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

in main() you also have to call punchmeinthehead()

int main()
{
    getlast(pastName, maxin);
    getfirst(firstName, maxin);
    getmid(midName,maxin);
	
    punchmeinthehead();
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It doesn't matter where you put those declaration, just look at the changes I made to main() function.

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

>>When I use stdout the program does not allow me to enter the Patient's Name but simply moves on...
In that case the problem is elsewhere in some code that you didn't post. Most likely using scanf() to get a numerical data entry. After that call getchar() to extract the '\n' key that scanf() leaves in the keyboard buffer.

>> I want to understand what the real difference between them
Nothing, they are equavilant.

>>how it affects to overall program in terms of efficient coding.
It does nothing for that -- completly up to you which way you want to do it. The compiler could care less and the results are identical.

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

Please re-read my previous post because I probably changed it since you last read it.

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

Is your program actually calling the function punchmeinthehead() ? That function looks ok to me.

I think the problem is in main(). The global variables are never getting populated because in main() you pass variable namein to all three functions and never copying the results to the global variables. You don't need namein, just pass the name of the global variable.

#include "nameinp.h"
#include <iostream>
#include <string.h> 
using namespace std;


char lastName[maxin];
char firstName[maxin]; 
char midName[maxin];

void main()
{
    
    getlast(pastName, maxin);
    getfirst(firstName, maxin);
    getmid(midName,maxin);
	
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you have to declare the same symbols in ONE *.cpp file without the extern keyword. Such as

#include "nameinp.h"
#include <iostream>
#include <string.h> 
using namespace std;


char lastName[maxin];
char firstName[maxin]; 
char midName[maxin];

void main()
{
	const int n = 16;
	char namein[n];
    
	char lastName = getlast(namein,n);

	char firstName = getfirst(namein,n);

	char midName = getmid(namein,n);
	
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

in the code I posted just replace main() with any function name you wish. syntaxially it doesn't matter what function name you give it.

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

line 20: fflush() is only defined with output streams such as stdout. What you have is undefined behavior. Since the line about is an output line maybe you meant to use stdout instead of stdin.

either line 21 or 26 will work, as well as this: fgets(section_1[tally1].first_name, sizeof ((PATIENT_DATA*)0)->first_name, stdin); The reason the above works without crashing the program is because the sizeof operator is evaluated at compile time, not runtime. So the above is not really dereferencing a NULL pointer.

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

I think what you are trying to show is a normal function such as main(), and all executable code must be inside a function.

int main()
{
    char* array = new char[255];
    strcpy(array, "Hello");
    strcat(array," ");
    strcat(array, "World\n");
    cout << array;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>do all the strcpy and strcats go in {} braces?

No, except they must appear inside a function such as main().

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

>>but how do I pull that value from the size_t totallength function? do I do this?

Define a variable to receive the value returned by that function

size_t len = totallength();
char* fullName = new char[len];

>>char *fullName = new char[]; // with the box filled in

That is STILL wrong!

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

>>char *fullName = new char[];
You didn't tell new operator how many characters to allocate. put a number (or int variable name) between those square brackets.

Here's how to copy the strings

strcpy( fullName, lastName);
strcat( fullName, " ");
strcat( fullName, firstName);
// etc etc like above
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>it isn't giving the total cost (cost * prodquan), just the cost that the user entered. I'm so close!

what function? [edit]nevermind you already told me that :) [/edit]

line 186: you didn't tell the program to print that information. You have to add it to your program.

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

Newegg is the site of choice for most. Tiger Direct has some good buys, but most involve mail in rebates.

http://www.newegg.com/
http://www.tigerdirect.com/

Agree -- that's where my son always gets parts.

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

line 189: add getchar() to make the program stop and wait for input.

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

you need two variable -- highest and lowest. Initialize them to be the value of the first array element. Next code a loop to count from 1 to the number of items in the array, then test each array element against those two variables, and change the variable value to be the array element when appropriate.

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

where is the array A declared ?

>>I don't know how to call these values.
You don't call values -- you call functions. So I don't really know what you are asking here.

>>I can only think of return A[j] and that doesn't work
why not? what are the some of the errors your compiler spits out ?

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

I would start by reading a whole line at a time, then checking to see if it contains a space(s) and number at the end. if it does then set variable size to that number and read that many names.

>>dynamicArrayClass myArray(size)
That won't work because it will allocate only enough space (hopefully) for the first set of names. You didn't post the code to dynamicArrayClass so can't say much more about it. If you used the standard c++ template <vector> the allocations would be taken care of for you and the array will grow as you add items to it.

vector<string> array;
// read a string not shown
array.push_back(name);
// read another string  not shown
array.push_back(name);
// etc. etc

In order for your dynamicArrayClass class to work it would have to have a resize method that will expand (or contract) the array.

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

most likely 2) your fault. You are probably not using the same compiler and/or operating system that the program's author used. Post a link to one of the programs so that we can take a look at it. And what compiler/os are you using?

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

line 37: never use eof() because it doesn't work the way you think it does.

You can easily read words one word at a time and ignore all white space by using the stream's >> operator

a combination of stringstream and fstream's >> operator should complete your program. stringstream is subclass of fstream so it has all the same functions/operators

string line;
while( getline(infile, line) )
{
     // split the line up into words using 
     // stringstream's >> operator then output a "\n" at the end
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In order to print the '\' character you have to use two of those little boogers.

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

>>Wow, no one after an hour? Is it that hard or did I just mess it up that badly
I was naping :)

function totallength()
The parameter must have a variable name, you can't just put a data type without a variable named. Variable names can be omotted ONLY in function prototypes.

line 26: why did you bother to calculate the total length then turn around and toss the answer into the bit bucket by returning 0 ?

You also need to add 1 for the new string's null terminating character.

You could reduce that entire function to just one line

size_t totallength()
{
   return strlen(firstname) + strlen(midname) + strlen(lastname) + 1;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

use two '\' characters similiar to how you did it in the open statement. out << "Some Text" << "\\" << '\n';

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

>>cout<<tail<<head<<cost<<capacity<<endl;

use the loop counter in this line cout<<tai[i]l<<head[i]<<cost[i]<<capacity[i]<<endl; >>If possible I would like to try and figure out how to have it display the titles on top of the numbers...

Simple -- print the titles just before line 36 (before the loop starts)

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

line 168: two problems:
1) doesn't look like malloc() was everf called to allocate space for name. That will most definitely crash the program.
2) you are passing a pointer to a pointer in that function. Remove the & because name is already a pointer.

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

take all the shopping channels off, but someone must be buying all their crap or they wouldn't be selling it on tv.

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

>>How do u define a 2by 5 array..is it mean
Yes you are right.

>>how do u figure out how many elements in the array?
first dimension times second dimenson. Very similar to a chess board where there are 8 rows and 8 columns, which means there are 64 squares. That's the same identical concept with 2d arrays. In your example 2 X 5 = 10 elments.

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

To add numbers to your lines, simply do this:

[code=C++] // paste your code here

[/code]

Not supposed to use c++ any more. use cplusplus instead of c++.

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

I think you have to write a CGI program using C, C++ or some other language. Whatever you use you have to write out the entire page using HTML markup language.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
string Words2;
while ( getline(Read, Line, '\n') )
{
      if( line.find("Word:") == 0) 
      {
           Words2 = Line.substr(Line.rfind(":") + 1);
      }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't have your compiler so I probably can't help very much. Link errors means that you have not include one or more libraries in your project.