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

Here is a lawfirm tht specializes in domain name disputes, at least those in USA. It contains links to quite a few recent legal decisions. I only scanned the first two and the complaint was denied in both cases.

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

What about 64bit arhitecture? Will be there on Vista Win64 API?
Jan

I don't know if there will be a 64-bit version of Vista or not, but 64-bit XP is indication there will NOT be one because device drivers (such as for video) are few and far between.

If so will the code be same?

Depends on how the code is written. Code that assumes the size of data type (such as a HANDLE is the size of a long) will have porting problems. The quickest way to find out if you have C++ 2005 Pro is to turn on the option that checks for 64-bit problems and compile the code.

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

you have a couple options:

1. use strtok() in a loop to extract the individual strings and copy the text into another string array.

2. use a pointer and strchr() to locate each colon then copy the text into another string up to the pointer that was returned by strchr().

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

yes

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

>>but its not working properly
what doesn't it do that you want it to? Not everyone has your compiler so you need to explain what it does wrong. Compile errors? executation errors?

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

>>i tried if(*q=="") but it gave an error
use single quotes with a space between them, like this: if(*q==' ')

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

you don't need the check for isalph on line 4 -- it really servers no purpose.

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

sorry -- we are not a software factory.

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

I believe you are correct -- there have been several law suits about that here in US. But I think you should contact a lawyer in your country soon to find out the legality there.

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

You must have another function in your program called GetComputerName(). Your code snippet compiled without error in a simple test program that only contains a main() function.

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

why did you post string.h? that is a standard header file that is supplied by your compiler and you should not be changing it nor making a copy of it and adding it to your project.

The problem is probably in mygetopt.c which you did not post.

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

you missed my post as well ;)

thanks!

yup, sure did. That's what happens when several people post at nearly the same time.

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

When I compile it, at line 20 I get the following error:

error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

What am I doing wrong?

you missed my post -- read it again and you will find the answer.

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

you forgot to include <string> header file.

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

I just tried it with VC++ 6.0 and it compiled ok too.

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

that compiler are you using? If its VC++ 6.0 then yes you need to upgrade.

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

its the IDE that is more difficult, not command-line builds. We don't all build programs as if we still lived in the dark ages :)

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

Read other threads on this board for many excellent discussions and suggestions -- shuch as this one.

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

you are compiling your program with UNICODE set. Turn UNICODE off by selecting Project --> Properties, Configuration Properties, General, then set the "Character Set" to "Not Set"

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

What are dialogs?

My profesor says that Visual has a lot of mombojambo. Maybe he means for bigeners?
Or does he?

yes, he means for beginners. I do not suggest VS compilers for beginners because they are somewhat compilcated to use. Dev-C++ is better for learning the language.

And you should not attempt to write windows GUI applications either until you have a firm understanding of the C or C++ languages.

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

using VC++ 2005 Express I created a new console project, added the three files you posted -- GradeBook.h, GradeBook.cpp and main.cpp. Everything compiled with no errors or warnings.

The code you posted is ok. So y0ur problem must be the way you created the project and files.

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

Why?

And if I have to switch form Dev to Microsoft, is that going to be a real pain in the ars?

Microsoft compilers are better than Dev-C++ -- by that I mean they produce tighter and faster executables. Also Microsoft created the OS with their own compilers so by definition M$ compilers are fully compatible with their os. Thirdly when you buy a M$ compiler you get a lot of stuff with it that is not available to any other compiler, such as it has a great IDE that helps you code for the os.

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

your code is attempting to open the same file for writing multiple times. You can't do that because the same file can be opened for writing by only one program at a time -- write mode requires exclusive use of the file. What you want to do is create an array of 200 filenames (or however many you want). There are better ways of generating the filenames, but I used this one for simplicity.

char *filenames[] = {
  "patienten/patientent1.txt",
  "patienten/patientent2.txt",
  ...
};

int tel; 
FILE *bestand_patienten[200] = {0};  
for (tel = 0; tel < 200; tel++)
{         
bestand_patienten[tel] = fopen(filenamest[tel], "w");
fprintf (bestand_patienten[tel], "hallo");
 
}

// now close all those files
for (tel = 0; tel < 200; tel++)
{         
   fclose(bestand_patienten[tel]);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This version compiles without errors. In this version I combined the .h and *.cpp into one *.cpp file for simplicity, but you should keep them separate if you wish. I also added the main() function at the bottom of the code. Hope this helps.

#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;
//GradeBook's class definition
class GradeBook
{
public:
GradeBook(string);
void setCourseName(string);
string getCourseName();
void displayMessage();
private:
string courseName;
};

//#include "GradeBook.h"// to tell the compiler i am using resources from class GradeBook
GradeBook::GradeBook(string name){
  setCourseName(name);
}
void GradeBook::setCourseName(string name){
 if(name.length() == 0){
  cout<<"\nName was not Entered";
 }
 if((name.length() > 0)&&(name.length() <=25)){
  courseName = name;
 }else 
  if(name.length()>25){
   courseName=name.substr(0,25);
   cout<<"\nName \""<<name<<"\" is more than 25 characters and has been truncated to 25"<<endl;
  }
}
string GradeBook::getCourseName(){
 return courseName;
}
void GradeBook::displayMessage(){
  
 cout<<"\nWelcome to the grade book of : "<<getCourseName()<<endl;
}

int main()
{

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

It doesn't really matter what compiler you use, although Microsoft compilers are better at building MS-Windows GUI programs then Dev-C++. Current version of Borland C++ may be ok too, but I've never used it.

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

you have to print the data at the same time you print the boxes. With standard C or C++ functions you can't first print the boxes then write over them with data. Do them both at the same time.

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

some comments as requested:

lines 19 and 20 can be combined

cout << "\nEnter interest rate:";

spacing and general program formatting style is pretty lousy. Indentation should be consistent throughout the program.

put line 66 on the same line as line 64 then delete empty lines between.

delete lines 6i0, 61 and 62. They appear to be just an infinit while loop.

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

The problem is that the class must end with a semicolon. Put a semicolon after the closing brace on line 13 of the header file

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

I loved this Jeep commercial. Not the normal commercial, this one lets you interact with the film, you get to chose among serveral alternate scenes in order to find the end of the commercial. I made it in 17 out of 44 possible scenes.

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

well i thought i should create a new array cause i have no idea how i can remove a number from the array using realloc ...

locate the element that contains the value you want removed. Then move all lower elemenets up one place to overwrite that elemement. That will leave the last element of the array unused. Then call realloc() to allocate the array 1 element smaller then it was before.

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

variables have to be declared in the function in which they are used. function binary_search() is not the same function that line_num was declared in.

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

1. you did not include the header file <string>

2. If you are not declaring using namespace std: after the includes then you need to declare the namespace at each object instance. For example, line 6 would read

GradeBook::GradeBook(std::string name){

and line 21

std::string GradeBook::getCourseName(){

alternatively, you can add #using std::string after the header file inclusion.

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

sometimes books contain errors. please post the code you are trying to compile so we can help you.

>>i am getting fed up
we all feel that way at times. But don't give up. When you feel really frustrated, walk away for awhile and do something else, like watch a good movie on TV.

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

>>fstream.open("i:\\markp\\cis223\\populated_places_us_sorted.txt");

fstream is a c++ class. You have to create an object of that type then call it's open method. Something like this:

fstream in;
in.open("i:\\markp\\cis223\\populated_places_us_sorted.txt");

or a little simplier

fstream in("i:\\markp\\cis223\\populated_places_us_sorted.txt");
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

thnx a lot for the concern but i didn unders

ptr+=6
i want to copy the string in str variable

strstr() returns a pointer to the beginning of where "source:" begins. Since "source:" is 6 characters long, ptr+6 increments pointer ptr to the character immediately following the colon. Then all you have to do is copy the remainder of the string, beginning at ptr, to wherever you want it.i

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

Are there any compliers with additions that will fix some things, simple things like length_of(Array), treat_as_value(char).

Not in C or C++ languages.

So many things that would make the programing both easier and less taxxing on memory and processor time. And if it was compiled to exe it should retain portability or am i missing something?

C/C++ is probably the least taxing of all computer languages except assembly and machine code. Other languages, such as basic, let you do some things a lot easier but the executable programs are generally larger and slower.

If you want to get reall deep into parsing equations then try YACC (Yet Another Compiler Compiler)

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

>>if(strstr(buf,"Source"))
watch the spelling and capatilization. strstr() is case-sensitive meaning Source and source are not the same thing.

char *ptr;
if( (ptr = strstr(buf, "source:") ) != NULL)
{
    // increment the ip address following the colon
    ptr += 6;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

please read through the Read Me posts at the top of this board -- they contain a wealth of information.

Here is a link to good win32 api tutorial

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

I am totally clueless here, so how do i put the x value (width) into x and y value (height) into y
(where x and y are int datatypes)

did you read the link? First create a RECT object and pass a pointer to it to the GetClientRect() function. After that just assign x and y with simple subtraction of the RECT left, right, top and bottom integers. If you can't figure that much out then I doubt your ability to write a program that uses win32 api functions at all. Start with something a lot simpler.

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

Thanks for the help. From now on I'll just create blank projects without stdafx.h and stdafx.cpp.
However, I'm still curious about the way stdafx.h works and why it needs to be included to .cpp files in the project other than main.cpp.
Could anyone shed some light on this, please? It would be most appreciated.

stdafx.h is just a header file that contains other standard and non-changing header files that are used by most *.cpp programs. For example you might write a win32 api program that consists of 10 *.cpp files. Since they all contain windows.h, string, vector, and several others you can just put them all in stdafx.h. Then when the VC++ compiler begins the build process the first thing it does is preprocess everything in stdafx.cpp (which only includes stdafx.h) and saves that in a precompiled header file for use by the other 9 *.cpp files. This saves a great deal of compil time on large projects. For example, I started working on a medium sized project at work (about 100 or so *.cpp files). The original programmer turned off precompiled headers when he created the project. It took 45 minutes the first time I tried to compile the project with VC++ 2005. I spent a few minutes adding precompiled headers back in, and then it took only about 5 minutes to compile the project.

I've seen some programmers complain about precompiled headers because it causes all those header files to be included in all *.cpp …

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

GetClientRect() returns a RECT object with the coordinated, then simple subtraction will give you height and width.

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

You can do this to have the same effect:

#define a +

int b = (2 a 3);

But 'a' is not really a variable here.
And I see no reason why you would want to do that...

You might want to do something like that when writing a calculator. for example, if you enter "2 * 3" then your program needs to figure out what to do.

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

you can use it in a switch statement

int b = 1;
int c = 2;
int d = 0;
switch(a)
{
   case '+':  d = b * c; break;
   case '-':   d = b - c; break;
   case '/':   d = b / c; break;
  // etc
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

its a bad link -- doesn't work now.

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

Thanks for replying. But where's the READ ME?

Look at the top of this page

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

so much for amusement. Thread is now closed. You may continue the sillyness in Geeks Lounge if you want.

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

Oops no I didn't thank you. Feel free to delete this anyone.

You're welcoms -- but I won't delete the thread.

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

did you read this FAQ and problems thread?

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

all I see is a small square in the upper-left corner of the window with I click that link. Is that what you are talking about?