15,300 Posted Topics
Re: use atoi() to convert ascii to integer, then use sprintf with "%x" format argument to convert the integer to hex string. | |
Re: [URL="http://www.lvr.com/serport.htm"]Here[/URL] is some good info and tutorials. | |
Re: >>Any thoughts? Nope, since you didn't post any relevant code. | |
Re: post the error message. and more of the code | |
Re: select File --> New --> Project, then just follow the prompts in the dialog boxes, select Win32 console application radio button. The IDE will create the project with a *.cpp and *.h files. After than, select menu Build --> Build Solution. | |
Re: do you have your compiler set up to define UNICODE and _UNICODE macros? Otherwise, I don't know a thing about Chinese language. Also, [URL="http://www.tek-tips.com/viewthread.cfm?qid=1329439&page=2"]here[/URL] is something I found with [URL="http://www.google.com/search?hl=en&q=c%2B%2B+program+that+uses+chinese+characters"]google[/URL]. It appears your computer needs to have Chinese language installed. | |
Re: inline code such a the remove() function should be limited to just one or two lines of code. Anything larger should be put in the implementation *.cpp file. | |
Re: Here is another example [code=c] #include <windows.h> #include <iostream> using namespace std; int main() { HKEY hKey = 0; char buf[255] = {0}; DWORD dwType = 0; DWORD dwBufSize = sizeof(buf); const char* subkey = "Software\\Microsoft\\Office\\PowerPoint\\AddIns\\MultiMgrAddIn.AddInDesigner1"; if( RegOpenKey(HKEY_LOCAL_MACHINE,subkey,&hKey) == ERROR_SUCCESS) { dwType = REG_SZ; if( RegQueryValueEx(hKey,"Description",0, &dwType, (BYTE*)buf, &dwBufSize) == … | |
Re: I don't get any errors or warnings when compiled with my compiler -- VC++ 2005 Pro. Maybe you don't have your project set up correctly. Your code is ok. | |
Re: [URL="http://www.daniweb.com/techtalkforums/thread23641.html"]Here[/URL] | |
Re: why don't you toss that horrible QBASIC and use something more modern, like the free Visual Basic 2005 Express. Its free for the downloading from Microsoft site. You can do all the printing your heart desires :) | |
Re: > char *data2=malloc(strlen(data)); > memset(data2, 0, sizeof data); So if data is an array of 50 chars, and it currently has a 5 character string in it, you allocate 5 bytes, but clear 50. This is not good. Actually it is clearing only 4 bytes on 32-bit os and compiler … | |
Re: >>I thought the void ment no variable-values are taken to the separate function and none are returned. It does mean that -- and the function is working as expected. But the [b]void[/b] does NOT mean the function can't change global data. >>test[10] = test[10] + 1; array [b]test[/b] only has … | |
Re: [QUOTE=proxystub;326201]although Ive opened the file using object.open("") the condition to check that there is indeed an open file always fails and i get my else message "file could not be found"[/QUOTE] make sure the file d.txt is in the same directory (folder) as that the executable file is running. If … | |
Re: please read the sticky posts (the threads with [b]ReadMe[/b] in front of the subject) at the top of this board -- they contain a wealth of information for you. | |
Re: something like this example?? [code] vector<stirng> array1; vector<string> array2; array1.push_back("Hello World"); // copy the first string in array1 into array2 array2.push_back(array1[0]); [/code] | |
Re: never ever include one *.cpp file inside another one. #include's are only for header files with *.h extension and often with no extension at all. If your program consists of two or more *.cpp files then each file should be compiled as a distinct unit then finally all object files … | |
Re: you have mis-matched curly braces. The open brace on the do-loop is matched to the last close brace in the function. This is one reason I always place curly braces on lines by themselves so that they are easy to spot and match up. Some compilers IDEs and code editors, … | |
Re: I'm not a pascal prpgrammer so I can't write the program for you, but it will be the same in any language. First create three string objects called month, day and year then use substring (or something similar) that will extract the appropriate digits from the original string into each … | |
Re: [URL="http://www.arrakis.co.uk/movie.html"]Dune[/URL] my favorite si-fi movie. Dr Who my favorite si-fi tv series. We in US just saw the first epesode of Robbin Hood on BBC America last night. Looks like it will be a good series. | |
Re: >> don't know how to separate it like this. see [URL="http://www.cs.cf.ac.uk/Dave/C/node17.html"]frexp()[/URL] in math.h | |
Re: First you need to declare a 2-dimensional character array whose dimensions can be allocated at runtime. [inlinecode]char **array = 0;[/inlinecode] Next, after opening the input file read the first line which is the number of words in the array. That tells you the number of rows (the first dimension) to … | |
Re: [quote] [color=red]>If the world stopped having sex all together, what do you think would happen?< [/color] That's pretty hypothetical, but it would probably increase the amount of conflicts and even wars. As those horny guys in charge of militaries around the world got more sexually frustrated than they already are, … | |
Re: some of those registered users are really spammers whose posts have been deleted. I don't know if banned users are counted in that number or not. Some people register for the sole purpose of posting spam and have no intention of participating in DaniWeb community. | |
Re: It would help if you would learn how to use tabs and spaces correctly so that your program is easier to read/understand. As it is few people, if anyone at all, will bother to read it. And what are lines 9 through 11 supposed to do? Must be a copy/paste … | |
Re: >>The nature of this application is that it needs to be extremely fast. So shaving nanoseconds is important to a degree. If speed is that important then don't use c++, but use C instead. And code in assembly when needed to optimize some time-consuming algorithms. I don't think virtuals make … | |
Re: first I would create an array of 126 integers because there are at most 126 possible characters on the standard keyboard. Initialize all ints to 0. Then loop through the array and use each character as an intex into the array so that its element can be incremented. When done, … | |
Re: you have to post code because I can not see your monitor from where I am sitting :) The most common reason the window closes quickly is because you did not add any code to make the window stop so that you can read it. If you are coding C … | |
Re: If you are compiling a.cpp what makes you think a.h is not being included? | |
Re: >>There is a problem in the execution of cl.e file No, there is nothing wrong with the compiler. Your program is really quite a mess. I tried compiling it with VC++ 2005 Express and got trillions of errors. Correct the problems one error message at a time. Recompile your program … | |
Re: >> if ( (file_pointer = fopen(filename, "rb")) == NULL ) The program should be open for reading a text file not a binary file -- "rt" not "rb". [inlinecode]for( j = i; j >= 0; j-- )[/inlinecode] j should start at (i-1) because the ith row at that point does … | |
Re: [inlinecode]void values(int a[4]);[/inlinecode] That is a function prototype that tells you and the compiler that function [b]values[/b] will have one argument and the argument is an array of 4 integers. [inlinecode]values(x[4]); (cannot convert int to int* and type mismatch in parameter 'a' in call to'value(int *)'[/inlinecode] Here you are not … | |
Re: modf() will help you split a floating point number into its integer and fractional parts. see [URL="http://www.die.net/doc/linux/man/man3/modf.3.html"]man pages [/URL]for more details8 | |
Re: argv[0] parameter in main contains that info. [code] int main(int argc, char *argv[]) { printf("%s\n", argv[0]); return 0; } [/code] | |
Re: >>t of all, is it called a This pointer or a This operator? [b]this[/b] is a pointer. An operator is something else. c;ass pbkects are [b]private[/b] by default. If you want to make them [b]public[/b] then you need to specify it. functions need to have a return type, c++ does … | |
Re: You didn't say but I suspect that may be an old 16-bit program that is accessing ports directly. If that is correct then you will have to rewrite the program using win32 api [URL="http://msdn2.microsoft.com/en-us/library/aa363194.aspx"]communications functions.[/URL] I think you will also find some examples in those links. | |
Re: Yes, [URL="http://www.amazon.com/Vampire-Book-Encyclopedia-Gordon-Melton/dp/157859071X"]vampires are undead[/URL]. [URL="http://en.wikipedia.org/wiki/Undead"]The term "undead" was coined by Bram Stoker in his original book Dracula.[/URL] Wikipedia has a large list of what is normally considered undead things. Undead creatures are considered evil -- I'm not evil so I wouldn't be any undead thing. | |
I don't like the new format of the threads -- a brief list of thread links at the top of each thread (I don't know what they are called). I find them annoying and almost useless, especially in Geeks Lounge where some threads have hundreds of posts. And it looks … | |
Has anyone successfully installed Acrobat Reader? It downloads ok, uncompresses, then gives the error message "The Temp folder is on a drive that is full or is inaccessible. ...". I used command prompt to display the values of all environment variables and the TEMP is in d:\users\<full path here>. Anyone … | |
Re: [QUOTE=christina>you;321938]Iowa is a state in the west. (of the US).[/QUOTE] Its actually in the mid-west -- that's where I was born and raised, just a few miles North of Des Moines. Iowa is a great state to be from -- a loooooooooong ways from :mrgreen: | |
Re: no -- you have to write your own. Makes for good practice sharpening your programming skills.:cheesy: | |
Re: what are the compiler errors? | |
Re: Select Project --> Properties expand Configuration Properties expand Linker select General category add path(s) to the libraries in "Additional Libray Directories" click Input category under Linker add library names in "Additional Dependencies" | |
Re: Hey Dude -- apparently you are the only one who used an iPod :mrgreen: I don't own one either -- I just got my first cell phone for Christmas and I rarely use it. ![]() | |
Re: I don't have a clue what question you are asking. function ch_in_string() -- there's a lot easier way to do that. std::string has a find method [code] bool ch_in_string(char ch, string s) { return s.find(ch) == string::npos) ? true : false; } [/code] | |
Re: [QUOTE=bananenflip;321277]I'm so sorry for asking but where should I insert or save C++. I'm skilled in html css and javascript but I don't get this.[/QUOTE] Your compiler will normally create an executable file in the same directory as the source code, or possibly a sub-directory. Unlike html and java to … | |
Re: >>Room& Room (const Room &node) { constructors do not have return values. And you forgot the class scope operator. It should be like this: [code] Room::Room (const Room &node) {[/code] >>Room Room::operator=(const Room& node) { you forgot the reference operator in the return type which line is line 44? | |
Re: [QUOTE=lasher511;320995]Yea it has only its not constantly popping up for stupid little things it only really pops up when you want to install a program that has to change settings or that has permission to wake up/unlock my computer for example my alarm clock program does this. Plus it was … | |
Re: 512 * 512 * 512 * 4 = 536,870,912, or about 524 meg. Does your computer have that much RAM? Check the return value of malloc() -- it will return NULL is not enough memory to allocate. | |
Re: >>I've sedn how they get it to work using an array, but I can do it that way...Thanks do you mean you are not allowed to use arrays or you don't know how to use arrays ? Where does main() start? I see some exceutable code that is not inside … |
The End.