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

Absolutely and most definately not. The first thing all dictatorships do is take away the ability of its citizens to defend themselves. And it has been demonstrated over and over again, time after time, that crime INCREASES when guns are restricted or banned.

Just one of many many examples

http://justfacts.com/guncontrol.asp

  • In 1982, a survey of imprisoned criminals found that 34% of them had been "scared off, shot at, wounded or captured by an armed victim." (16c)
  • Washington D.C. enacted a virtual ban on handguns in 1976. Between 1976 and 1991, Washington D.C.'s homicide rate rose 200%, while the U.S. rate rose 12%. (1)

>>It always makes me laugh when I hear, "guns don't kill people, people kill people." I don't see many people killing each other with a spork.
Thats because you are an idot and have no clue. Many people have been killed with knives, pitchforks, and all sorts of objects.

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

Sorry, beats me why it doesn't link. Someone else with better knowledge of templates than I will have to figure this one out. I added <fstream> and <ostream> but neither of them helped. I also had the compiler generate the *.i file (a file that the preprocessor generates) but that didn't show up anything useful either.

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

First of all you will need to use a database to save all that appointment stuff. The database can be as simple as a text file or as complex as an SQL compliant database such as Microsoft Access, SQL Server, Oracle, Sybase, etc (there are quite a few of them).

Next I would create a structure to hold all the event information for everything in the file and a <vector> of those structures. On program startup read the event file into memory. After that you can populate the list box with the events.

You will need to implement one of the CListBox event handlers so that it's called whenever a line is selected (I don't recall the exact name of the event but you will find it in the list your compiler provides you). Then inside that event handler you can populate all the other controls on the window with the information obtained from the vector of structures.

I like working with MFC -- it can be a lot of fun, but also very challenging. You can get a lot of code and working ideas from www.codeproject.com. I have been a member there for many years and have downloaded lots of free code to use as examples.

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

I used VC++ 2010 Express and did not get that link error. All I added was this to the bottom of what you posted (after the #endif)

int main()
{
    ArrayList<int> a;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

According to this

The .STF file extension identifies a Setup Information file which relates to Microsoft's Setup procedures and may contain tabular index information for use by this function.

You probably need some sort of Microsoft Installer program to generate that file.

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

There is no universal answer -- only 3d party libraries such as curses.h. You can do something similar to what I posted by using terminfo functions but it would be easier to just use curses. I looked at conio.h and did not see anything useful there, at least not in the Microsoft port of that file.

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

>>void main()

main should never be declared like that. The only acceptable way to declare it is int main() or int main(int argc, char* argv[]); what is userinput? It has not been defined. Your compiler should have produced an error on that line. If you ignored the error than shame on you!

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

>>And the code was working as expected. This is very funny. I am not how the hell this was working.

What compiler are you using? Most recent compilers will produce either an error or a warning because of that omission. If you ignored that warning, then shame on you ;)

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

I think you would have more success by reading the entire line with fgets() then just write the line into the output file starting with the 3d byte of the input buffer

char inbuf[255];
while( fgets(inbuf, sizeof(inbuf), Numbered) != NULL)
{
    fputs(&inbuf[2], Filtered);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

With a MS-Windows 32-bit (or 64-bit) compiler you will have to use the console functions in windows.h to get and set the current cursor position. Something like this:

#include <Windows.h>
#include <stdio.h>

void gotoxy(int x, int y)
{
    // set the current cursor position
    COORD coord;
    coord.X = x;
    coord.Y = y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}

COORD getxy()
{
    // get the current cursor position
    CONSOLE_SCREEN_BUFFER_INFO info;
    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info);
    return info.dwCursorPosition;
}

int ndigits(int n)
{
    // calculate the number of digits in an integer
    int x = 0;
    while( n > 0)
    {
        x++;
        n /= 10;
    }
    return x;
}

int main(int argc, char* argv[])
{
    int x,y;
    COORD coord1, coord2;
    printf("Enter two numbers\n");
    coord1 = getxy();
    scanf("%d", &x);
    coord2 = getxy();
    if( coord2.Y != coord1.Y )
    {
        gotoxy(coord2.X+ndigits(x)+1, coord1.Y);
    }
    scanf("%d", &y);
    
	return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You could always marry a very rich window with one foot in the grave and the other slipping.

>>I just had left the job because of my transfer issues
Bad move. Get a job before moving so that you will not be unemployed.

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

>>close(mfdprot);
You probably meant fclose(mfdprot)

Sounds like your operating system is buffering up the data. Try adding fflush() before fclose().

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

The compiler will generate a pointer to the first character of a character array if all you pass is the array name, The & symbol is optional. If you want a pointer somewhere else in the array then you have to use the & operator and tell it which byte you want the pointer to start.
char buf[255];
scanf(buf, ...);

The above line is the same as this one:
scanf(&buf[0] ...)

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

>>If you cannot log in, please email me at cscgal@daniwebmail.com ... Thanks!!!!!

That's a bit like the message "keyboard undetected -- press any key to continue" :)

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

>>but the dos.h functions WORK in WindowsXP
Actually not. They work in a DOS emulation window, which emulates MS-DOS 6.X, not MS-Windows. You can not make dos.h work with any 32-bit compiler because they use priviledged instructions which the 32-or 64-bit operating systems will not allow.

conio.h is spported by many 32-bit compilers because there are no functions in it that directly attempt to call privileged instructions. I stepped into kbhit() function and it eventually calls win32 api console functions. I suspect the other functions do the same thing.

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

#1: The use of variable i is not the problem. The problem is that you failed to use { and } to surround multi-line if statement

for (int i = 0; i < gameLibrary.size(); ++i)
{
        counter = i;
        cout << counter << "-";
        cout << gameLibrary[i] << endl;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you were alive before Pluto was even discovered.

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

if one is both, how can he/she answer the question?

Humans do not have hermaphrodite qualities so your question is nonsense. :)

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

Tubbo C is not a 32-bit compiler. It was written 20 years ago for MS-DOS, not Windows.

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

The beep sound is generated by the operating system, not MessageBox. Go to Control Panel, then Sounds. But you can also call the win32 api function Beep() if you want to generate your own sound.

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

32-bit compilers such as Dev-C++ do not support any of the functions in dos.h. Those functions won't work on MS-Windows operating system since Win98 (10-20 years ago).

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

you might try something like this. That should read one line from each of the three files until one or more reaches end-of-file.

while( inFile3>>x, inFile4>>y, inFile6>>5)
{
    utility1= x- delaycost- y-z;
    util2 << utility1 << endl; // ???? Don't know if this is right or not.
}

Now, what to do about that computation. What are you supposed to do with utility1 after computing its value???

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

Look carefully at those while loops. See anything strange (wrong) with them?

Take the first set of while loops. The first thing that will happen is that inFile6 will read the entire file while inFile3 and inFile4 remain constant (they won't read any more. After inFile6 reaches end-of-file the inFile6 loop exists and control returns back to inFile4, which will read the next record. The inFile6 will again attempt to do more reads, but it can't because its at end-of-file. The program will go back to inFile4 and read another record then repeat the error all over again. That will continue until inFile4 reaches end-of-file. At that time control returns back to inFile3, which read the next record .

In other words, your program is just a big f**ked up mess :)

jonsca commented: It's great when one can use the technical terms +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

how to do what? Open the file? This will simply open the file but doesn't do anything with the file's contents.

#include <stdio.h>

int main()
{
   FILE* fp = fopen("somefile.bin", "rb"}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

MessageBox.Show() has several overloaded functions. Read the list here and you will see how to do that.

As for books -- search amazon.com and you will find them.

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

Opening an image file in C language is no different than opening any other file. Its what you want to do with it after that which can get tricky. Either your instructor is very very stupid or just didn't want to be bothered with your question.

And yes, you can write 3d games in C language. It just takes a lot of experience and knowledge of C language. If this if your first semester learning the language then you are not yet ready for writing 3d games. Start out a lot simpler by writing text based games. DaniWeb has a whole games forum where you can ask in depth questions about games.

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

Actually, the loops in both code snippets are wrong. Why? Because eof() doesn't work like that. It only detects eof-of-file AFTER an attempt has been made to read the last item in the file, so the last item will get processed twice.

A better way to code it is like this, which will exit the loop upon end-of-file and will not process the last item in the file twice.

while( fin >> next )
{
   // blabla
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I did't realize Dev-C++ could generate 16-bit code like Turbo C. dos.h is not supported with 32-bit compilers.

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

You are right -- his two-year-old post did provide the solution to the problem.

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

You are right -- Code::Blocks with MinGW does not contain those header files either. Under MS-Windows, <sys/socket.h> can be replaced with <winsock2.h> and the project will have to use ws2_32.lib library. There may not be a windows port of the other two header files.

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

>>it is all about technology. our brain sizes will increase resulting in heads several times bigger than what we have today.

That was the subject of a episode on either "The Twilight Zone" or "Outer Limits".

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

@bruce965: That compiler/IDE has not been updated for quite a few years -- delete it from your computer and upload free Code::Blocks or VC++ 2010 Express.

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

post the contents of the input file. Does it contain numeric digits only or can it contain non-numeric characters? How to parse the file will depend on what it contains.

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

>>However, we allow the bbcode to be used within code tags that are not syntax highlighted to point out specific items.

only [color=red] works. Other colors are ignored.

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

Flying American flags in front of my home, having a cookout, then working at WalMart this evening until 10:00 p.m.

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

Sorry to hear that. Please give it my sympathies.

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

If you want to see the source code for std templates such as list then just look at the header file. But be prepared for some pretty awful looking code :) The ones from Microsoft are nearly unreadable, at least it is for me.

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

#1: repaint the entire screen in the same color. Something like this:

RECT rect;
    HBRUSH hBrush;
<snip>
    case WM_PAINT:
        hdc = BeginPaint(hWnd, &ps);
        GetWindowRect(hWnd,&rect);
        hBrush = CreateSolidBrush(RGB(255,0,0));
        SelectObject(hdc,hBrush);
        FillRect(hdc, &rect, hBrush);
        EndPaint(hWnd, &ps);
        DeleteObject(hBrush);
        break;

#2: I know of no way to do that. The program is created for either text or windows, the two can not be mixed in the same program.

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

>>So why the difference in responses solely based on gender/career choice?

Because for the past one million or so years it has been women's place to be in the home raising children. It's only been during the past 50 or so years (it started in WWII) that women have ventured out into employment. It may be a hundred or more years before women will be accepted just as men are.

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

>>i wish to develop software on my own.

That's a bad place to begin. Start by working with a team of programmers so that you can take advantage of their experience and knowledge.

Have you completed a college bachelor's degree yet? If not, then you need to do that.

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

Trash that compiler and use vc++ 2010 express. Then you can write c++/CLR programs that does this.

Or do some googline about how to capture the window into a bitmap using win32 api functions.

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

operating system? compiler? we need a few more details

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

If the 8 bit variable is passed by value then there should not be a problem because the compiler doesn't pass 8 bit values anyway, the smallest that can be put on the stack is 16 bit variables (with a 32-bit compiler on an Intel beased computer). Casting can lead to huge problems if the variable is passed by reference (or pointer) because then the receiving function will be expecting a pointer to a 16 bit variable.

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

#1:

int fact = num;
for(int i = 2; i < num; i++)
   fact *= i;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I would probably write a batch file that contained the compiler parameters you want and then call that from Notepad++'s Run menu item.

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

The links don't work -- most likely because I'm not enrolled at that school, or the links have changed.

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

But since the project is very big will it possible to change it according to the opinions of a moderately experienced programmer or shall I have to start new?

Don't change a program just to improve its coding style. "Don't fix it if it ain't broken". If the program is already finished or nearly finished then make style changes only when something else needs to be changed.

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

What you posted is not a double linked list but just an array of People classes. Post the node structure of the linked list you are using.

The j loop starting on line 7 should start at (i+1), not 1. There is no reason to compare anything from 0 up to and including the value of i because they have already been sorted

for(int i = 0; i < (nr-1); i++)
{
   for(int j = i+1; j < nr; j++)
   {
      // etc
   }
}

The way I sort linked lists is to swap just the data, not the entire nodes, so that the link pointers remain in tact. It becomes even easier if you put the data in a structure so that you can just swap structures instead of individual data members.

The swap algorithm needs to iterate through the linked list.

struct node
{
   node* next;
   node* prev;
   Person p;
};

void sort(node* head)
{
   node* n1;
   node* n2;
   for(n1 = head; n1->next != NULL; n1 = n1->next)
   {
       for( n2 = n1->next; n2 != NULL; n2 = n2->next)
       {
          // swap data here if necessary
       }
   }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Once you know one language its not all that difficult to learn another. IMO VB.NET is easier to learn than c++.