15,300 Posted Topics
Re: use CString's GetBuffer() method, similar to std::string's c_str() int x = atoi(s.GetBuffer()); | |
Re: > in other words be muslim). Wong. Be Christian. If you don't believe in Jesus Christ then you will most likely burn in Hell for all eternity (there are a few exceptions). | |
Re: > ave a problem in which i want to declare two pointers of undefined length....so i don't want to use malloc... you have to use malloc() to allocate space in which to store the characters received from scanf(). If you don't want to use malloc then you have to declare … | |
Re: Start [here](http://en.wikipedia.org/wiki/Hirschberg's_algorithm) | |
Re: Which flavor of BASIC will they use? The current one is VB.NET and the compiler is available for free at[ this link](http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express). [Here](http://www.homeandlearn.co.uk/net/vbnet.html) is a brief introduction tutorial you can study | |
Re: use wi[n32 api drawing functions](http://www.toymaker.info/Games/html/gdi.html) | |
| |
Re: You use the pointer operator -> to access structure members. See line 18 in the code below for example. [code] struct person { char lname[80]; char fname[80]; }; struct person* foo() { struct person* p = malloc(sizeof(struct person)); <snip> return p; } int main() { struct person* p = foo(); … | |
Re: > Blame a medical condition rather than a corrupt system. What system do you mean? Who says its corrupt? Just because you think so doesn't make it so. And what do you think the President should or can do about it? There is little anyone can do to keep someone … | |
Re: Do you have a \*.h file and/or \*.lib that does along with the dll? | |
Re: > Is there any built in function? No. There are probably image libraries that you can get, some free and others not free. I never tried to do that so I don't know. | |
Re: how it works depends on the hardware. If you buy a small robot then you will have to read their programmer's documentation to find out how to interface a computer with it. If you build your own then I suppose you can design the commands yourself. You might want to … | |
Re: [QUOTE=ArkM;671319]In essence, char type in C (but not in C++) is a very short int, that's all.[/QUOTE] I think you will find char data type is the same in both c and c++. ![]() | |
Re: Two problems with that code 1. theData in Data() is just a local variable, so line 12 us useless, does nothing. 2. arrays declared inside function can not be returned from the function, attempting to do so will cause sig faults, as you have found out. To correct the problem, … | |
Re: It depends on how the log file was written. If it is in binary mode and written with fwrite() then you can use fread() to read each record directly into the structure. Otherwise if its text mode and written with fprintf() then use fgets() to read it and pars the … | |
Re: > I should mention that there is no function in the standard library for deleting files Yes there is -- [remove()](http://www.cplusplus.com/reference/clibrary/cstdio/remove/) > The same applies to renaming a file. See above link | |
Re: > can anyone explain ...at what time memory is allocated for variables... Intel based computers -- All local variables are actually allocated by the compiler immediately upon function entry, even the variables that are declared later within the function. (You will see this if you let your compiler produce an … | |
| |
Re: >>exactly every second I need to call a particular function Neither MS-Windows nor *nix is that accurate, actual time may be +/- a few milliseconds, depending on what else the operating systems and other processes are doing. | |
Re: > note : sorry for the bad english Don't underestimate your command of Engligh language -- its much better than many native English writers I've seen. | |
Re: Is userip char\*? If yes, then to put a space before it you will have to move current text right one character to open up the byte in which to put the space. For example, if userip originally contains "255.255.255" then you will call memmove() to shift all characters right … | |
Re: can you post some same data? Need to know what's in the file and how its formatted. | |
Re: I tried that link, my entire screen turned white, pressing Esc did nothing, so I killed the browser in Taek Manager. | |
Re: The first thing to do is design the database. What database engine do you want to use? MySQL, MS-Access, Orical, ... there are dozens of them. Do you know SQL? If not then you will have to study/practice it. There are lots of books on amazon.com that help you with … | |
Re: Have you seen [URL="http://tangentsoft.net/mysql++/doc/html/userman/tutorial.html"]this example program[/URL]? Put an if statement around line 21 to insure the query succeeded. | |
Re: why templates? So that you don't have to write different functions that all do the same thing but with different data types. That's how its done in C language. For example if I need a function that returns the sum of two numbers but it need to handle int, float, … | |
Re: > int k=12; Now try this and you will see different behavior static int k=12; | |
Re: Its not that simple -- see[ this article](http://en.wikipedia.org/wiki/Floating_point) | |
Re: function pointers can only point to static class methods or global c-style functions. You will have to make PrintIt() a static method if you want to do that. | |
Re: variable a is an single dimensional array which will hold only one string. What you want is something like this: char a[20][30]; which is a 2d array that holds up to 20 strings, and each string can contain up to 30 characters (29 + null terminator). | |
Re: > use strlen Maybe, but maybe not. Depends on what you want, strlen() and sizeof() may return different values such as when the buffer contains embedded '\0' characters. | |
Re: Do you mean which compilers you should use? Of course before you can write a program you have to know something about what the program is to do. For example you can't write a program to fly a ship from Earth to the moon without knowing something about astronomy. You … | |
Re: There is no such thing as "simple" example. You have to use win32 api [Communications Functions](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363196(v=vs.85).aspx). After calling CreateFile() to open the serial port you will have to fill out a [DCB structure](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363214(v=vs.85).aspx), then call Bu[ildCommDCB()](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363143(v=vs.85).). After than you call ReadFile() and WriteFile() to read/write to the port. [Here](http://www.ewoodruff.us/CUJArticle/CUJArticle.html) is … | |
Re: >i understand my memmove output but why it is same as memcpy? Both functions produce the same results. The only real difference is whether the destination and source buffers overlap. If they don't, then use memcpy(), otherwise if they do then use memmove(). | |
Re: > Visual C++ used to have support for makefiles It still does -- Visual Studio 2012 RC | |
Re: If a[0][0] and a[0][1] are both null-terminated strings, then you have to call strcmp() to check of the two strings are the same. The following will produce a two-dimensional array of strings that contain up to 40 characters each. char a[2][2][40]; strcpy(a[0][0],"Hello"); strcpy(a[0][1],"World"); if( strcmp(a[0][0], a[0][1]) == 0) { printf("Both … | |
![]() | Re: Necroposting -- I had to look that one up. Its nothing new -- people have been doing that for years. I haven't noticed any increase on DaniWeb in recent weeks. |
Re: > Can some one list all the functions in windows.h You will have to buy a book to get that kind of information. [See any of these](http://www.amazon.com/s/ref=nb_sb_ss_i_1_19?url=search-alias%3Dstripbooks&field-keywords=windows+programming+c%2B%2B&sprefix=windows+programming%2Cstripbooks%2C157&rh=n%3A283155%2Ck%3Awindows+programming+c%2B%2B) | |
Re: >>return *(--s1) - *(--s2); That may give you the wrong result. It should be [icode]return *s1 - *s2;[/icode] There are four possible return values [list=1] [*] If *s1 is '\0' and *s2 is not, then the return value will be some negative value. [*] If *s1 is NOT '\0' but … | |
Re: move lines 9 and 43 down into main() then pass the file2 to print() as a parameter. Open the file only once, just before the loop that starts on line 69. Also, fstream objects must be passed to other functions by reference. | |
![]() | Re: Don't post anything that is copyright by someone else without their permission. The accepted way to do that is to post a partial quote then add a link to the original article. |
Re: This code compiles with vc++ 2012 RC, but its not tested. void foo(int n2, vector<int> a) { int temp, cnt; vector<int>::iterator y; for (int i = 0;i<n2;i++) { cin>>temp; cnt = 0; y = lower_bound(a.begin(),a.end(),temp); if (*y == temp) cout <<temp<<"found at"<<int(y-a.begin()+1)<<endl; else cout<<temp<<"Not found"<<endl; } } | |
Re: > hey..m a student of last year of BCA Please STOP posting as though you were texting on your cellphone. This is a forum, not a cellphone. If you expect people to take you seriously then you need to spell out the words. There are lots of people here who … | |
Re: See the example [here](http://msdn.microsoft.com/en-us/library/system.io.file.openwrite.aspx). Delete fstream from your program because it won't work with Windows Forms, which is CLR/C++, not c++, two different languages. | |
I tried to make a post without code snippets of any kind in Geek's Lounge and got this error message >The code snippet in your post is formatted incorrectly. Please use the Code button in the editor toolbar when posting whitespace-sensitive text or curly braces. I found out that it's … | |
Re: Best if you just ask [7zip forums](http://sourceforge.net/projects/sevenzip/forums/forum/45797) yourself | |
Re: Does the folder have anything in it? If not then just delete it. If there are files, check to see if there is an uninstall program. Since there is not anything in control panel/programs then it is probably safe to just delete the folder. I'd rename it to something else, … | |
Re: Several ways to do that, all of them require basic understanding of C and/or C++. If you are using VC++ 2010 Express or newer you can create Windows Forms which is based on the language CLR/C++, similar but different than standard c++. If you use Code::Blocks then you can use … | |
Re: You are attempting to mix two different languages -- c++ and CLR/C++. Since you are using CLR/C++ (Windows Forms) then you must use System.io.File class instead of <iostream> and <fstream>. Forget about using standard c++ header files, they don't work with CLR/C++. Other container classses are in the compiler's include/clrext … |
The End.