15,300 Posted Topics
Re: [QUOTE=Gigs_;260616]HI, I have exe file writen in c++ or c and wanna decompile it to source code. Is that possible? If it is, is there any decompilet that can do that? thanks![/QUOTE] No, it is not possible to decompile back to C. The best you can do is get the … | |
Re: There are probably several ways to do it, but I would use the string search feature of std::string class [code] std::string line = "<FILE_NAME>Testfile.dat</FILE_NAME>"; std::string filename; size_t pos; if( (pos = line.find("<FILE_NAME>") > string::npos) { filename = line.substr(pos+11); // truncate the </FILE_NAME> tag pos = filename.find('<'); filename = filename.substr(0, pos); … | |
Re: >>A loop and a decision perhaps? something similar to this? I know its not exactly what LucyB wants, but google for "flow charts" and you will find other examples. | |
Re: >>What am I missing? You are missing WinProc() function as explained in the error message. | |
Re: >>if( kbSize == 2000 || 3000 || 4000 || 5000); There are several things wrong with the above statement: 1) the semicolon at the end makes it a do-nothing statement. 2) it should be formatted like this: [icode]if( kbSize == 2000 || kbSize == 3000 || kbSize == 4000 || … | |
Re: check the spelling -- capatilization is important | |
Re: VT_BSTR can not be directly converted to std::string because a BSTR is UNICODE wchar_t*, not char*. You have to use one of the conversion functions. Here is an example, when compiled with VC++ 2008 Express you must compile for UNICODE (the default) [code] #include <windows.h> #include <tchar.h> #include <string> #include … | |
Re: The first problem is line 25 -- count the ( and ) pairs. line 28 and 31 have the same problem [icode]if ( (hours<3) && (hours>0) )[/icode] | |
Re: [QUOTE=asharrajpoot;772981][code] A B C D E F G G F E D C B A A B C D E F G F E D C B A B C D E G F E D C A B C D G F E D A B C G F … | |
Re: fstream us standard c++ class so it works the same on all operating systems that support them. WritePrivateProfileString() does nothing more than rewrite the file with the new string in the form [icode]<tag name>=<value>[/icode]. You can do this yourself with ofstream. [code] ofstream out("filename.ini"); out << "[MySectionName]\n"; // beginning of … | |
Re: >>and all the code is correct Then why is getWord() never called to read the words from the file? You are on very dangerous ground with that replace function. The intent of the function is to replace one word with another word within the sentence. Lets say I enter a … | |
Re: This is c++, not C. So use c++ ifstream to read the file one word at a time. Is there a need to keep the individual fields with the entire line? If not, then you don't have to keep them in memory, just read the file one word at a … | |
Re: I'm not sure what you are trying to accomplish, but that header file is really unnecessary. Both functions are coded in code.c and the header file will not prevent that. But you should get an error in main.c because fcn2() was not declared (because ifdef'ed out in the header file). | |
Re: line 32 and 33: That doesn't work because the string is located in read-only memory, and attempting to write to that memory will most likely fail. Correction: This puts the string in writeable memory. [icode]char BlankPattern[]="###############";[/icode] line 39: The above doesn't work either because you can not return a character … | |
Re: That second one from 1970 was right on target. The speaker was exactly right about how the computer would change our buying habbits. | |
Re: [URL="http://en.wikipedia.org/wiki/Category:Executable_file_formats"]Here is a list of file formats[/URL] -- there might be more, I don't know. I didn't know a.out was a file format -- just thought it was a filename. | |
Re: you probably want [icode]vector<ofstream> fileList;[/icode] Now all you have to do is loop through the names and open the files, something like this: [code] vector<ofstream fileList; fileList.resize(argc-1); for(int i = 1; i < argc; i++) { fileList[i].open(argv[i]); } [/code] Now to write something to all the files just use another … | |
Re: 1) It can be used in either text or binary, but most often used in binary files. Not very meaningful in text files. 2) The [b]type]/b] is the object that is store in the file. For example, lets say you saved a bunsh of Personnel c++ classes, then it would … | |
Re: spanking is one thing -- and ok. beating is quite another and punishable by some prison time. Parents who have a hard time distinguishing between the two need some serious time with a head shrink. | |
Re: for a beginner, get the free [URL="http://msdn.microsoft.com/vstudio/express/vb/default.aspx"]VB.NET Express edition[/URL]. >>what is the diffrence between vb.net and visual basic language can u please tell me Nothing, the are one and the same. vb is an abbreviation for "visual basic". .net is the newest version. >>what is the diffrence between vb.net and … | |
Re: Or just convert to int, add one, then convert back to string, as previously suggested [code] char phone[] = "0000000"; int ph = atol(phone)+1; sprintf(phone,"%08d", ph); [/code] | |
Re: gets() is NEVER safe to use because it can corrupt the memory of your program and cause it to crash (or coredump in *nix). [URL="http://www.gidnetwork.com/b-56.html"]Read this explaination[/URL]. | |
Re: > `char *str = new char();` Do you really mean something like `char *str = new char(Size);` so that more than 1 character is allocated??? Can't really tell much from the code you posted because there are several undefined variables -- such as **temp**. | |
Re: Might be a missing semicolon previous to line 81 in the *.cpp file, or missing header file, or missing declaration of INBUFF and OUTBUFF, or a host of other things. | |
Re: [URL="http://en.wikipedia.org/wiki/Plonk"]Plonk[/URL] >>waw man ur a great guy Oh! Narue when did you have a sex change :) And what is [b]waw[/b] [quote="Wikipedia"] WAW or Waw can mean: Watch and wait the letter Waw in the Hebrew, Arabic and other (mostly Semitic) alphabets IATA code for Warsaw Frederic Chopin Airport WAW … | |
Re: [QUOTE=edward_paul05;551633]i change my password now, ^_^ .[/QUOTE] I would hope so -- that was probably the dumbest thing I have ever seen posted here at DaniWeb since I first joined. Why didn't you just open your wallet and toss all your money out into the street? | |
![]() | Re: use [b]fgets()[/b] -- [URL="http://www.gidnetwork.com/b-56.html"]never ever gets() [/URL]-- to read the entire line from a file or from the keyboard. |
Re: >>vector<double> a(5); That creates an array of 5 doubles. >> a.push_back(1.2); That adds an additional element to the array, so after this line executes the array will have 6 elements. | |
Re: >>fin >> myArray The >> operator will stop reading at the first space or tab. If you want the entire line then use [icode]getline(fihn.myArray);[/icode] | |
Re: list errors. The last line -- VC++ 6.0 is old style C which forces you to declare all objects at the beginning of function. | |
Re: wxWidgets and OpenGL -- google for them. | |
Re: Very good :) | |
Re: [QUOTE=Salem;781091]> Your home planet is: Silbob Silbob Howdy neighbour :)[/QUOTE] Yup, I live there too :) So far Dude is the only odd ball here. | |
[url]http://www.youtube.com/watch?v=R8WI-o2I3vs&feature=related[/url] | |
Re: >>temp.m_buffer=new char[] m_length; Shouldn't that be this: [icode]temp.m_buffer=new char[m_length];[/icode] >>if(!m_length) That means if m_length == 0. When that happens strlen(other) == 0 and the previous new operator will return a pointer to a 0-length character array. So if the length of the allocated buffer is 0, how in the world … | |
Re: >>SavingsAccount.hpp(9) : error C2512: 'Account' : no appropiate default constructor available That means Account needs a constructor that takes no parameters. | |
| |
Re: start here. Sadly, we can't do a lot for you if you don't have your text book, unless you can remember how to program. [code] int main() { // your code goes here } [/code] | |
Re: Don't know what the problem is. Use your compiler's debugger and single-step through the code. Maybe it has a problem with the "/IM" parameter. Maybe that parameter should follow notepad.exe. | |
Re: What errors do you get? You only posted code snippet so its not possible for us to compile/test your code. you declared [b]dic[/b] but never filled it with anything. So how in the world do you expect that loop to find a word in the dictionary? Why don't you just … | |
Re: Ask your teacher for homework ?? Or you could read through all the threads on this board and try to do the assignments yourself. | |
Re: did you see some of [URL="http://www.codeproject.com/info/search.aspx?artkw=get+recently+used+file+list"]these articles[/URL]? | |
Re: Below is some code I got from [URL="http://www.codeguru.com/cpp/i-n/network/networkinformation/article.php/c2499"]CodeGuru[/URL] [code] #include <iostream> #include <string> #include <winsock2.h> using namespace std; #pragma warning(disable: 4996) string hostn() { char szHostName[128]; std::string str; if( gethostname(szHostName, sizeof(szHostName)) == 0 ) { // Get host adresses struct hostent * pHost; int i; pHost = gethostbyname(szHostName); for( i … | |
Re: I didn't bother to memorize them -- let VC compiler generate them. Although I admit I would use MFC wxWidgets instead of pure win32 api. | |
Re: If you can change the content of the input file, change the ls command to report file names only. That would greatly simplify your program. | |
Re: I don't bother to read them, but I certainly will now :) |
The End.