15,300 Posted Topics
Re: I tried it with both VC++ 2008 Express and Code::Blocks 8.02 on Vista Home Premium. No problems or errors. With both compilers I first created a project and compiled for debug. This is what Code::Blocks console window [quote] Hello world! Process returned 0 (0x0) execution time : 0.040 s Press … | |
Re: c++/CLR String class is not the same as c++ string class declared in <string> header file. Look up [URL="http://msdn.microsoft.com/en-us/library/system.string.aspx"]system::String[/URL] class and review its methods You can not use <string> in CLR/C++ programs, so you might as well delete that header file. Example: [code] using namespace System; int main(array<System::String ^> ^args) … | |
Re: you forgot to make pointer b point to anything. [icode]struct s* b = &a;[/icode] | |
Re: The parameter to FindFirstFile() is wrong. If you want to find all the files in c:\\MyDir *.c then use that as the parameter to FindFirstFile. Note: The code below has not been compiled or tested. This is supposed to concantinate all the command-line parameters to make a single path statement. … | |
Re: It's called Token Concantination. See[URL="http://en.wikipedia.org/wiki/C_preprocessor"] this wiki article[/URL] about preprocessor directives. Scroll down until you find the section titled "Token concatenation". [Edit] Oops! Didn't see your answer Narue. | |
Re: Sending data to a laser printer is very complicated. You could use win32 api printer functions, such as EnumPrinters() and OpenPrinter(). | |
Re: >> Is c++ useful? Naw -- that's why there are millions of programs written in c++. | |
Re: sounds like you are talking about MS-Windows. dlls "and crap" are used to make the exe files smaller. If you have two *.exe that each use function foo() then put function foo() in a dll so that all *.exe programs can use them. dlls are libraries of pre-compiled code that … | |
Re: Text is probably declared private in Form1. In Form1 write a public get and put functions to expose Text to the public. | |
Re: search [url]www.codeproject.com[/url]. It has probably the largest repository of C++ and MFC code available on the net. If there is such a control, then they will have it. | |
Re: When is your assignment due? You will need to know about input/output functions like cin and cout, as well as arrays and optionally structures. You will need some way to hold the name of the item ordered and quantity of each item. You can do that with either two arrays … | |
Re: >>x="%d";main(b,a,t) Huh? Don't know what that is. >> for(scanf(x,&a);a>0;a=0) Odd loop -- assuming a starts out to be greater than 0, the loop will execute exactly one time. Don't you want to change "a=0" to a-- ? I would assume the code also has to compile cleanly ( 0 errors … | |
Re: You could just turn off all those emails so that you don't get them any more. There are options in your profile to do that. | |
Re: There are os specific functions to get a list of file names in a folder. MS-Windows: FindFirstFile() and FindNextFile() *nix: opendir() and readdir() google for those function nanes and you will find out how to use them. I've posted a [URL="http://www.daniweb.com/forums/search.php?searchid=16559526"]couple code snippets here[/URL] to show how to use them … | |
Re: If you are just starting to learn assembly then those books for 32-bit systems will also work on 64-bit systems. Err -- I mean that it won't matter whether you use 32 or 64-bit computers. I first learned assembly during the late 1980s by reading a book by Peter Norton. | |
Re: [QUOTE=Soubhik;1542149]I'm interested in graphics programming. what library do I use for graphics programming in C if graphics.h is deprecated??[/QUOTE] On MS-Windows use a modern compiler such as VC++ 2010 and win32 api graphics functions. c++ gives you many more options. | |
Re: call win32 api function [URL="http://msdn.microsoft.com/en-us/library/ms633497(v=vs.85).aspx"]EnumWindows[/URL](). For each window M$ will call your callback function with the handle of a window. In that callback function call [URL="http://msdn.microsoft.com/en-us/library/ms633520(v=vs.85).aspx"]GetWindowText[/URL](). Then all you have to do is strcmp() the returned text with that name. If its the window you want then send it a … | |
Re: Student life hell???? HaHaHaHa. Wait until you have to actually work for a living. Your time in college is only the bare beginning. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/aa376868(v=vs.85).aspx"]ExitWindowsEx()[/URL] | |
Re: Your teacher is correct. You do not put executable code in header files (there are a few exceptions) because the code gets duplicated in each *.cpp file in which the header file is included. Lets say you have two *.cpp files, and each one of those includes the header file. … | |
Re: did you read [URL="http://technet.microsoft.com/en-us/library/bb457065.aspx"]this[/URL] ? Or research [URL="http://www.google.com/search?hl=en&q=windows%27+EFS+&btnG=Google+Search"]these google links [/URL]? | |
Re: instead of swap() use erase() e.g. [icode]my_map.erase(my_map.begin(),my_map.end());[/icode] Then you can delete lines 15-18 of the code snippet you posed. | |
Re: what compiler are you using? Many old c++ compilers use now-deprecated iostream.h | |
Re: Your first suggestion is not workable because as previously explained the first letter can be one of several commands. But your second suggestion is the best way to write the program. | |
Re: I was always heavly addicted to tobacco until I quit about 10 years ago. Quality of life has greatly improved since then. | |
Re: post declaration of nameList. If it's std::string namelist[size] then there will never be a NULL entry. | |
Re: [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS397&q=how+to+write+tsr+in+c&aq=0&aqi=g1g-v1&aql=&oq=how+to+write+tsr+"]Here [/URL]are a few google links that can probably help you. If your computer is running MS-DOS Version 6.3 or earlier then TSRs should be ok. It's not likely they will run under either Vista or Windows 7 command prompts. | |
Re: Its horribly recursive -- and illegal by today's C standards. But the code is using long-obsolete original K&R syntax. | |
Re: On MS-Windows use [URL="http://msdn.microsoft.com/en-us/library/aa364418(v=vs.85).aspx"]FindFirstFile[/URL]() and FindNextFile(). [URL="http://www.daniweb.com/software-development/cpp/code/216612"]Here [/URL]is a more extensive c++ example. | |
Re: You wouldn't have any of those problems if you used VC++ 2010 (the Express edition is free). Code::Blocks is also an excellent IDE that has option to install MinGW compiler. I never used Eclipse so I don't know how to resolve your problems with it. I assume you are working … | |
Re: remove the -ansi flag and you won't get those warnings. The only reason I know of to use -ansi it to compile old lagecy code, written last century. | |
Re: Just copying the lib files into your project directory doesn't solve a thing. You have to add the lib names to the project settings. Its been a long time since I used that version of the compiler and don't recall how to do that. | |
Re: I compiled it with VC++ 2010 Express and got no such warnings or errors. Are you sure you are compiling this as C program instead of C++. With vc++2010 *.cpp files are compiled as c++, not C. Change the file extension to *.c and recompile. >>Vector is a C collection … | |
Re: what do you mean by that??:S You need to explain your question in more detail | |
Re: nezachem is correct -- you have to allocate memory for the value using new. If that didn't work, then post your new code. You must set DataSize = number of bytes in Value before calling RegQueryValueEx(). assert() only works when you compile the program for debug. It does nothing at … | |
Re: Microsoft does not directly support a grid control that is editable. To solve that problem I have used [URL="http://www.codeproject.com/KB/library/gridprojects.aspx"]this grid control[/URL] very successfully. For your project you will have to use either ODBC or ADO (depending on the databas you want to use) to do the queries and get the … | |
Re: did you try [URL="http://www.google.com/search?hl=en&q=Apriori+Algorithm+for+finding+frequent+itemsets&btnG=Google+Search"]google[/URL]? | |
Re: I don't think there is anything like that for c++ because c++ programs are pretty much operating system specific. Yes the language itself is os independent, but to make c++ programs do anything worthwhile they have to make os-specific function calls, and the programs have to be recompiled for each … | |
Re: The first thing you need to do is check your computer's file system and see if the file name you enter is in the same directory as where your program is running. If it is somewhere else then you need to specify the full path to the file, such as … | |
Re: why do people post *.zip files that can't be opened by WinZip??? What did you use to create that file? | |
Re: The difference depends on the compiler you are using. Some compilers treat them the same, while others don't. With vc++ the <> tells the compiler to only look in its standard include directories (there are options to add to the list of directories), while the "" tells the compiler to … | |
Re: >>typedef int Addr_t; Why are you assuming addresses are integers? They aren't. Redefine that as [icode]typedef char* Addr_t;[/icode] or [icode]typedef Tree* Addr_t[/icode], or whatever data type it is. If you need a generic pointer than [icode]typedef void* Addr_t;[/icode] should do it, then you can typecast it to the appropriate type. | |
Re: The errors mean that you failed to write the implementation code for those functions. | |
Re: >>I'm not doing this inside any operating system Oh! :-O Then how are you running that program? | |
Re: You will probably have to do things a lot differently when porting from C to CLR/C++. Microsoft has made a lot of things much easier to do. [URL="http://www.codeproject.com/KB/IP/socketsincsharp.aspx"]Here[/URL] is a tutorial for C#, which is a very close relative of CLR/C++. | |
Re: >>It's also somewhat difficult to differentiate between a legitimate member making inane comments and a sig spammer. I use post count and past posting history for that purpose. First time posters on PFO who make that kind of post get the post deleted, but not infracted or warned because there … | |
Re: you have to use the os GUI functions which depend on the os you are using. Displaying a progress bar with C language is a great deal more difficult than it is in java or many other languages. | |
Re: The link error tells you that you have a symbol defined in two or more source files. You will just have to read all your source files to find the offending symbol. One way that can happen is to declare global variables in header files. To do that correctly you … |
The End.