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

"a simple os" and "gui interface" are contradictory statements. Something like MS-DOS 1.0 was a simple os. Once you add gui it becomes very very complicated.

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

which line did the error occur on ? And make sure spelling and capitalization are all consistent.

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

Do a print screen then attach the bitmap so we can see what you mean.

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

Dirty IT job No. 5: Ability to withstand a variety of environments and personality types; concealed-weapons permit a plus. Individuals with anger management issues need not apply.

Try installing the computer and your program in a flour factory where the employees have to wear a mask because the air is filled with so much flour! Yes, I had to do that once, and had to put the computer inside an environment cabinet.

In another instance I went into a doctor's office because the receptionist complained that the printer wouldn't work. I walked in, turned the printer on, and walked out! That doctor got a nice bill for those few minutes :)

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

well... it IS the case, and it's apparantly NOT easy.

for one thing it's not one nation forgiving the debt of another.... it's multinational banking organizations who have to answer to powerful investors across the globe.

perhaps you have an inside angle?

The banking system is nearly collapsed now anyway, so they might as well just forgive the debt.

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

Yes we figured that out. But did you read the other comments here, e.g. post #7 ?

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

what errors? I can not see your monitor.

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

Well first:
OMG!!! I dont know what you were trying to mean by OMG and :scared:

If you are not native English then maybe you will not know what OMG means. Here is a link

I was exclaiming great surprise at the inefficiency of the code you posted.

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

Welcome to DaniWeb.

>>Just built custom computer and i want to learn linux
Good luck! Come back in about 10 years and tell us how it went :)

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

I know a sociologist (Ph.D.) who did that. He wrote a book and made $Billions.

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

I was tempted to just delete it.

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

what a totally useless waste of bandwidth and our time! Whoever filmed that obviously doesn't live where I live because we have millions (billions!) of birds all over the place.

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

i had a problem a little while ago, just assumed you were working on the servers. Didn't last more than 5-10 minutes.

nav33n commented: Even I assumed the same :) +11
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

i have heard that i need to "fulsh the input"
please help me!

read this thread

Your coded would look a little better if you used a switch statement instead of all those if statements.

cin >> numberofopponents;
switch( numberofopponents )
{
    case 1:
           // blabla
           break;
    case 2:
           // blabla
           break;
    default:
           cout <<" does not freakin compute"<<endl;
           break;
    
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you need to adjust the pointers next pointers too. such as temp->previous->next = temp-->next; . If your linked list does not have a previous pointer, then you need to keep track of it while iterating through the list in lines 4 and 5 of the code you posted.

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

>>I am getting a linking error stating buffer is too small
There is no such linking error. Post the exact error message.

>>strcpy_s(cstr,sizeof(cstr), str.c_str());
That is wrong because sizeof(any pointer) is always 4 on a 32-bit compiler. what you want is str.size().

>> *tail--;
>> *head++;

remove the stars because you want to increment the pointers, not the character to which they point.

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

>>if(str1==str2)

Can not compare two strings like that. use strcmp() if( strcmp(str1,str2) == 0)

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

thank you so much sir , how do you get so good at this is it just from reading or is it just constant coding or ?

From many years of coding experience, reading and listening to others. The more you practice (coding) the better you will get. You don't learn how to drive a car overnight either.

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

Parse() is defined on line 72 as a member of CLOGFILE_INTERPRETERDlg. The declaration is not shown however.

Oh yes -- you are correct.

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

because i am getting complier errors when added onto my new code

#include <iostream>
using namespace std;


void input(int& hours, int& minutes);
void output(int hours, int minutes, char type);
int convertTo12Hour(int hours, char& type);

int main() {
  int hours;
  int minutes;
  char type;
  char answer;
 
  do
   {
    input(hours, minutes);
    hours = convertTo12Hour(hours, type);
    output(hours, minutes, type);

    cout << "Perform another calculation? (y/n): ";
    cin >> answer;

    } while ((answer == 'Y') || (answer == 'y'));

  return 0;
}
 
void input(int& hours, int& minutes) {
  cout << "Enter the hours for the 24 hour time: ";
  cin >> hours;
  cout << "Enter the minutes for the 24 hour time: ";
  cin >> minutes;
 }
//
// Displays a time in 12 hour notation
//
void output(int hours, int minutes, char type) {
  cout << "The time converted to 12 hour format is: " << hours << ":";  
  //
  // special handling for leading 0s on the minutes
  //
  cout.width(2);
  cout.fill('0');
  cout << minutes;
  //
  if (type == 'A')
    cout << " A.M." << endl;
  else
    cout << " P.M." << endl;
 }
 
   
      void Convert( int& hours )
   
      {
   
      hours = hours % 12;
   
      }
	  if( hours < 12)
{
    pm = 'A';
}
else
{
    hours -= 12;
    pm = 'P';
}

errors
Error 1 error C2059: syntax error : 'if'
Error 2 error C2143: syntax error : missing ';' before '{' 65 lab4
Error 3 error C2447: '{' : missing function header (old-style formal list?) 65 lab4
…

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

yes almost but i think the if else syntax is wrong?

you mean what I posted before? why do you think it's wrong?

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

I would guess that it's complaining because Parse() is not declared static. If you can arrange for Parse() to be static, AfxBeginthread() will be a lot happier.

That might be correct if Phase() is a method of some class. Not necessary to be static if Phase() is just a simple global function.

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

using an if else statement but what function i call i can put it in words but that's where i have a hard problem putting it into code
i know it would be something like
if hours < 12
pm = 12- hours ?
cout>>pm?

if( hours < 12)
{
    pm = 'A';
}
else
{
    hours -= 12;
    pm = 'P';
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Maybe you can avoid that, I am thinking something like this.

void Convert( int& hours )
{
	hours = hours % 12;

}

The problem is that will not tell whether it's am or pm.

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

im using HP-UX .vector implementation isnt possible coz a header file <stdin.h> (or <stdint.h> not sure ) is not available.,

vector is not declared in either of those header files. Its in <vector> header file, which will be supplied by every c++ compiler in the world except maybe some embedded compilers. So I think you need to search your compiler's include directory and I'll bet my boots it will contain a header file named vector (and without a .h extension)

#include <vector>
// other c++ code here
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh I see planList is a typedef. Well then just replace it

planList* singleIMEIarr = new planList[1000];

...
...
return singleIMEIarr;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

put it in the convert function that you started (see the last line that you posted) int convertTo12Hour(int hours, char& type);{ Delete that semicolon!

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

First do the math on paper & pencil. Once you get that right then coding it will be simple.

If the hours is greater than 12 just subtract 12 and the A.M./P.M. flag will be 'P'. Otherwise if the hours is less than 12 the flag will be 'A' and you don't have to do anything to the hours.

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

Make it a pointer

schedule_Mgmt::plainData* singleIMEIarr = new schedule_Mgmt::plainData[1000];

...
...
return singleIMEIarr;

And don't forget to delete[] that pointer in the receiving function.

Another alternative is to make it a vector passed in by reference so that getPlanData() can populate the vector

void  getPlanData(vector<schedule_Mgmt::planList>& list)
{
     

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

When I compile the program, I always got this error message:
C:\LOGFILE_INTERPRETER\LOGFILE_INTERPRETERDlg.cpp(355) : error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (void *)'
Error executing cl.exe.

Does anyone knows what is the problem with my codes?

Which one of those line is line 355 in your *.cpp file? My guess is the compiler is complaining about the symbol Parse -- what is it (its supposed to be a function) If Parse is a function make sure it has the return type that AfxBeginThead() expects.

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

doesn't matter why -- gets() is a horrible function anyway. Use fgets() instead of gets(). And if you really want the source code for that standard C function then download the gnu compiler source code.

Salem commented: Agreed, but the source for gets() et al will be in libc, not the compiler itself +29
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>return singleIMEIarr[1000];

That line is illegal.

>>but is there no way of converting (type casting) it to the class type ?
Why didn't you just use schedule_Mgmt::plainData structure instead of creating yet another structure with identical contents (starting on line 29 of *.cpp file)?

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

Your compiler is correct. If you want that function to return something else then change the return type on line 5 of the *.cpp file, and also in the class declaration. Functions can not return arrays like you are trying to do in line 162 of the code you posted.

Other problems:
line 162. that is a return line. The code following it will never get executed.

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

The code won't compile due in part to use of undeclared variables.

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

i did the same ..error is coming..can u explain me in coding ? plz

Post your code -- we can not see what you wrote. Also post error message.

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

I also have HP with 64- bit Vista, 6 gigs of ram, 4-quad, 720 gig HD. The only thing I did was to turn off User Account Control feature via User Accounts icon in the Control Panel. My login account has administrative rights. The only problem I have found is that IE7 (64-bit version) sometimes freezes and I have to use Task Manager to kill the process. Also there is no 64-bit version of some plugins. I installed 32-bit FF and have not had any problems with it at all.

As for utube videos, I have had no problems with them either. But I have not changed anything under Parental Controls because I'm clearly over legal age limits :)

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

>>so much of their GDP goes to paying the world banks' interest, they cant ever get out of poverty long enough to oust the military juntas and tribal dictators.

If that were the case then the solution would be easy -- get the world banks to forgive the debt, mush like USA did WWII debut by many nations.

don't talk like this , and I'm outside the US , so for me there are no US politics. actually I'm hating US for some reasons ! , so clearly I'm not talking their side.

Oh I see now -- you hate USA for everything but our money and computers. Well, that certainly is an eye-opener.

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

Great -- exactly what I was looking for :)

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

How do we get a complete list of member's names? I clicked Site Search, scrolled down to the botton and just clicked Search, but got something completely different. Some time ago there was an easy link to do this which included the name, number posts, rep points and maybe some other stuff too. But appears that list is no longer available -- at least I don't know how to get it.

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

use CreateProcess() instead of ShellExecute(). CreateProcess() will return a structure that contains the information you need.

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

OMG! Why don't you simply use vector's erase() method to delete an inventory item instead of all those assignment statements :scared:

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

The only way to do what you want is to use virtual functions. Make PrintMyType() in the base class a pure virtual function that has to be implented in the derived class.

Example:

class Base
{
private:
    virtual void PrintMyType() = 0;
public:
    void PrintAllInfo()
    {
        cout << "This is Account\n";
        PrintMyType();
    }
};

class derived : public Base
{
private:
    virtual void PrintMyType()
    {
        cout << "This is derived\n";
    }
public:
    virtual void PrintAllInfo()
    {
        Base::PrintAllTyes();
    }
};


int main()
{
    derived d;
    d.PrintAllInfo();
return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you might want to use a vector

vector<Data*> theList;
magazine* n = new magazine;
theList.push_back(n);
video* v = new video;
theList.push_back(v);

One problem in the above is you need some method to distinguish the class types when extracting them from the vector. Is theList[0] of class magazine or video? You might want an indicator (integer) in the base class.

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

I would send it a private message -- WM_USER+1 for example. But you will want to register the private message so that something else doesn't try to use the same number for another purpose.

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

And the grains of truth not immediately obvious from Ancient Dragons response:

1) To my knowledge NULL is a memory address that is gauranteed not to have a value associated with it. This address is not dereferenceable. It is often, but (to my knowledge) zero. But then again, my knowledge isn't all encompassing, so maybe NULL is gauranteed to be zero.

The definition of NULL for C and C++ differs; here is an example from the stddef.h header supplied with MSVC++ 8 (note: cstddef wraps and includes stddef.h in this implementation):

/* Define NULL pointer value */
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif

http://en.allexperts.com/q/C-1040/NULL-value-C-C-1.htm

As shown above, in C language NULL is 0 cast to a pointer, while in C++ its just simply 0. Although it might compile without error, I never initialize an integer with NULL because its intent is to be an initializer for a pointer.

Here is another thread I found interesting that gives a little more insite into this topic.

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

What types of items do you want to be derivities of a base class? Such as books, movies, newspapers, broadway plays, etc. ?

<list> is similar to normal linked lists. <vector> is like an array. Which to use depends on what you want to do with them. And both are far superior to the C counterparts (linked lists and array).

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

>>I'm a newbie, and I don't know how to convert long int to strings.
Two methods:
1) In c++ use stringstream class

#include <sstream>
#include <string>
#include <iostream>
using namespace std;
int main()
{
   int n = 12345678;
   std::string s;
   std::stringstream str;
   str << n;
   str >> s;  // converts integer to string
   cout << s << "\n";
}

2) use sprintf()

#include <cstring>
#include <iostream>
using namespace std;
int main()
{
    char str[40];
    int n = 123456;
    sprintf(str,"%d", n);
    cout << str << "\n";
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

hmm, in trying that, I discovered this:
but instead I see nothing! Why would that be? I was also seeing nothing with the \r, but I bet it's the same reason.

Thanks,
Dave

You wrote the wrong test program. Assuming you are writing this under MS-Windows os. If *nix then delete windows.h and replace Sleep() with sleep().

#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
    int counter;
	for(counter = 1000; counter < 10000; counter++)
	{
		cout << "\rhi " << counter; cout.flush();
		Sleep(250); // 1/4 second sleep
	}
    cout << "\ncounter = " << counter << "\n";
return 0;
}
daviddoria commented: Ancient Dragon has all the answers! +3