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

Not illegal as long as you don't take their program and call it yours. Make your program a little different than others already on the market and you should not have any legal problems. But you will want to do a lot of market research to see if there is any market for your program. If Product X does everything anyone would want and sells well then you might have a really tough time breaking into their market.

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

Who the hell can stop me from posting a topic multiple times

What an absolute moron. He sounds like a 5 year old who isn't potty trained yet and stll breast feeding.

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

Unlike null-terminated character arrays there is no such thing as a terminating character in other kinds of arrays, such as int, float or double.

You can use the sizeof operator to calculate the number of elements in an int array tht is declared in the same function

int main()
{
   int a[] = {1,2,3,4,5};
   // the  number of elements in the array is
   // the size of the entire array divided by
   // the size of one of the elements.
   int sz = sizeof(a) / sizeof(a[0]);

}

The above will not work on pointers or arrays passed as a parameter to a function (such arrays are always treated as pointers).

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

Repost the current program.

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

You mean a web site like this one?

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

The way I do it is to first call time() and localtime() to get the data as struct tm. Then use sprintf() to format the date into a character array

char date[40];
time_t now = time(0);
struct tm* tm = localtime(&now);
// now format the date -- I put it in yyyymmdd format so that the files
// can be easily sorted.
sprintf(date,"%04d%02d%02d", tm->tm_year+1900,tm->tm_mon+1, tm->tm_mday);
ofstream out(date);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Post the declaration of Node. If Note is defined as a pointer then your program might work.

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

the program works - end of story

When I ran your program with vc++ 2010 express the value of count was 20. That clearly is not the correct size of the array. And here is the output

18
29
3999
4444
56
6655
7667
89
9999
1056
1155
126
-858993460
-688908683
3733924
596607
1
2298896
2300960

number of elements in array ....> 20
Press any key to continue . . .

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

why do you keep posting that dribble?

>>while(a[count] != '\0')
That is an infinite loop. Why? Because the array that is creted does not contain a value of '\0'. So the loop will just keep searching throughout the entire memory of your computer until it encounters the first byte that does contain the value 0.

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

That is how to declare a two dimensional character array. Here is a short tutorial

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

Yes I know that problem -- and I already told you what it is. Your program has other problems too that you will discover after you learn how to debug your program. Asking us to debug your program for you is a huge waste of your time.

Basic debugging isn't that difficult. Set a break point (where execution of the program will stop) then step through it one line at a time. In VC++ 2010 Express there is a Debug menu that will have options to do that. You can probably learn the basics in less than an hour.

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

@dewi44: Your program is 100 % wrong. If you want to post code, ok, but test it out before posting. If I were a teacher your program would get you a big fat 0.

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

You said it was 16-bit console. Unix has never been a 16-bit operating systm.

@interrupt: doing graphics on a microchip may not be possible due to lack of memory. Drawing a button in C language will be no different than doing the same thing in c++. Windows Forms is CLR/C++ language and requires the operating system to have the .NET framework installed. There is nothing inherent in standard c++ that will let you do any graphics, that will require other libraries whether you use C or C++.

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

That is wrong too. C language was developed for Berkley Unix, not MS-DOS. I think you need to read your history books.

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

system("notepad.exe");

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

The function that calls the one you posted has to pass a pointer by reference, hence there are two stars not just one. If it did not do that then SortedInsert() would be unable to change the linked list declared in the calling function.

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

You need to learn how to use your compiler's debugger so that you can single-step the execution of the program and see for yourself what is causing the problem.

Hint: line 89 is in the wrong place.

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

When you used one of these.

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

>>But C is a 16-bit DOS oriented programming language, it uses 16 bit address scheduling

You are totally wrong dude. The entire Windows api was written in C language. You are obviously only familar with Turbo C which does have the limitations you mentioned. But if you come into the 21st century and get a compiler that isn't 25 years old, and has been obsolete 10+ years ago, you would have found out that the statements you made about C language is totally wrong.

VC++ 2005/2008 and 2010 are all 32 bit compilers that will gladly compile either C programs or C++ programs. Programmers have been writing pure MS-Windows programs using win32 api functions in C language for decades.

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

English lesson.

Only proper nouns are capitalized. The phrase "object oriented" is not a proper noun. The only other time to capitalize something is the first word of a sentence.

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

Try the suggestions made in this thread from Microsoft

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

They can't compile the program without everything. Again, zip them up.

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

2. You misunderstood me. I said the debug version requires debug version of Windows DLLs that other computer most likely do not have.

My computer (Windows 7) does not have a folder called Microsoft/CRT. I am using the Express version of vc++ 2010. If you have the Pro or better version then the compiler's install directory may alreay have to redistributable files that I gave the link to in my previous post.

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

You might be able to save them some time if you can make a library out of the files that do not need to be changed. Just start a library project, add the files to it, compile, and give them the *.lib along with all the *.h files.

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

You should also get 0 credit if someone else writes the program for you.

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

If they have to recompile then they will need all the source files. Use WinZip to zip it up and give them that.

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

No. Windows Forms require c++, not C. If your embedded device is running some version of MS-Windows then you might be able to use pure win32 api functions. But if its running *nix then I don't know.

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

When you distributed the final program all you give them is the *.exe or *.dll, whichever type your compiler builds. You do NOT give them the source file -- *.h, *.c, *.cpp or *.lib.

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

You can't use the debug version because (1) its size is at least twice the that of the release version, and (2) it contains alls to the debug version of Windows DLLs which other computers most likely do not have unless they also have the compiler installed.

Your orinal question did not ask about other DLLs that may be needed on another computer, you only asked about the files that are in the Release folder.

For other files, download from this link

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

Read the damed thread.

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

You only need one file -- the *.exe file. All the other files you see are just integmediate files used by the linker to build the *.exe file. You could have easily tested this yourself by copying the *.exe file somewhere else and executing it from Windows Explorer.

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

What does get_line() do? Does that function also read a line from the file? If it does then your program is reading two lines at a time before doing anything with them.

void readData ()
{
    FILE * pFile;
    NoOfRecordsRead = 0;
    char buffer [Line_Char_Buffer_Size];

    pFile = fopen (INPUT_FILE_NAME , "r");
   
    If (pFile == NULL) 
         perror ("Error opening file 'Countries.txt' !");
    else
    {
      while ( fgets(buffer, Line_Char_Buffer_Size,pFile) != NULL)
      {
         printf ("%d] aLine => %s\n", NoOfRecordsRead, buffer);
         globalCountryDataArray [NoOfRecordsRead++] = createCountryRecordaLine);
      }
      fclose (pFile);
    }
			
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Since you are using precompiled headers, stdafx.h must be the first include file in stdafx.cpp and all other *.cpp files of the project. Other *.h files can be included after stdafx.h and will not be included in the *.pch precompiled header file.

I don't think that is the problem though because the compiler would have given a different error message. So the only other possibility is that test.h is not located in the directory you think it is. It should be in the same folder as the other project .cpp files.

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

There is no c++ folder in the MinGW include folder and c++ programs compile just fine. Must have been some other problem.

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

Yes it does (version 10.05) still include MinGW. I guess that's the latest version

I'm running an older version, so I uninstalled it, then downloaded (binaries only) and installed the newest verson. Creted a new HelloWorld c++ program and it compiled without any problems.

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

I don't see SHOWERROR anywhere in the code you posted.

SAFE_DELETE is not really needed because delete and delete[] work correctly when the pointer is a NULL pointer. So there is no need for those two macros.

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

When you downloaded Code::Blocks did you get the version that contains MinGW compiler?

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

The maximum length of a std::string is about the same as the maximum value of an unsigned integer, which is pretty darned big (see limits.h -- 4,294,967,295 on my compiler). Its highly unlikely your query will come even close to that number of characters.

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

You can not add a Form to a pure win32 application program. They can only be added to a CLR style project.

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

Hardware Requirements:
- Computer that has a 1.6 GHz or faster processor
- RAM: 1 GB RAM for x86; 2 GB RAM for x64; An additional 512 MB RAM if Visual Studio is running in a Virtual Machine
- 3 GB of available hard-disk space
- 5400 RPM hard disk
- DirectX 9-capable video card running at 1024 x 768 or higher display resolution
- DVD-ROM drive

From this link

It also requires .NET Framework version 4.0 and DirectX 9.0. I don't know if XP can support them or not.

I guess is that your computer is too old, too little RAM, and too small hard drive to support everything you want to put on it. Time for upgrade.

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

From the looks of that crap you posted you need to start learning C all over again from scratch. Forget gui for now and take a refresher course in C. or buy a book and study it.

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

What! and you are attempting to write a gui program without the slightest notion of what you are doing :icon_eek: Does a person who doesn't know how to swim jump right into the water and attempt to scuba diving?? Do do you try to build a house before you know the difference between a screw driver and a hammer?

Start back at square one and learn C language from the beginning, not somewhere in the middle or end.

>>could you post the complete statement here
That was a complete statement.

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

The array is declared inside a function. All you declared globally is the structure definition. That is not enough.

#define NCARDS 100
struct card_t {
char name[20];
int top, bottom, left, right;
};

struct card_t cards[NCARDS];
// functions go here

not delete the similar declaration of cards[] from main() and delete the parameter in cardslist() function. Since the array is now global it's not necessary to pass it to a function that alreay knows what it is.

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

Of course there is a way. Just declare the array outside any function.

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

flex++ is not a c++ compiler. So anything you post in this forum about flex++ is useuess.

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

>>is there any way i could declare the structure elements globally
Yes, but global data is generaly frowned upon. Its very easy to access the structure in functions, just pass the array as a parameter just like you did with cardslist() function.

pcard = &card[0];
cardslist(pcard);

pcard is unnecessary. Just use card cardslist(card);

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

If you have the Professional version or better then you could use MFC (unmanaged code) or even Windows Forms (CLR managed code)

We've already covered invoking other application, so I won't repeat myself and others.

Databases. If it's an SQL compliant database like MySQL, Access, Oracle, Sybase and many others, you will also have to learn SQL. google for SQL tutorials and you will easily find them. After that you might want to learn ODBC, which is a very common set of database access functions. If you are using MySQL there is a MySQL++ c++ class that makes it a little easier.

If your data is not really very complicated and SQL might be overkill, then you could just write out the data in a normal text or binary file.

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

Of course there are other solutions. And the one you suggested will work too. Just create another buffer and copy the contents of sCmdInt into it.

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

The Best book would probably be subjective anyway. What I consider the Best someone else may not. Read through those threads and you will get the opinions of other people.

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

There are a number of ways to start another process. system() is just one of them. On MS-Windows you can also call CreateProcess(), ShellExecute(), and spawn(). The all do basically the same thing, but CreateProess() gives your program a lot more control over the process being executed than the other functions.

>>Does VisualC++ provide some mechanism or libraries to interface GUI with my C++ code?
Not the free version. With that you have to resort to pure win32 api function calls. But you could use the free wxWidgets c++classes.