15,300 Posted Topics
Re: [URL="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windowclasses/usingwindow.asp"]Here[/URL] is an example | |
Re: I see the program must be using curses?? Are you allowed to use non-ansi standard functions? >>Does this look correct to you guys How it "looks" is unimportant. Does your program compile with 0 errors and does it work ok when you run and test it? | |
Re: >>char *str="abcd"; There are two objects here -- the pointer itself is a variable that is on the stack. It contains the address of the string that is stored in the heap -- often in read-only memory. [edit]Sorry Holly I didn't see your last post when I posted this. The … | |
Re: Its not really all that difficult --[URL="http://bama.ua.edu/cgi-bin/man-cgi?popen+3C"] here [/URL]is an explaination of popen() and and example program. BTW you don't use system() with popen(), but call whatever program you want directly [code] char syscommand[BUFSIZ]; char inbuf[BUFSIZ]; sprintf(syscommand,"des -D -k %c%c credit0_e credit0",keys[i],keys[j]); if ((ptr = popen(syscommand, "r")) != NULL) while … | |
Re: Do you mean [URL="http://quantlib.org/"]Quantlib[/URL] open source library for quantitative finance ? I don't know a thing about it, but their web site has a lot of information including documentation and links to relevant forums. The site even contains links to example programs. | |
Re: Its unlikely you are being asked to write any of that with very advanced techniques such as using a graphics library, unless you are actually taking such a course. If this is your first year of programming then just use standard console-mode print statements to create small circles, triangles and … | |
Re: probably because [URL="http://www.cs.colorado.edu/~main/cs1300/doc/bgi/bgi.html"]BGI[/URL] requires a 32-bit compiler, which TurboC is not. Upgrade to one of the free compilers mentioned in that link. | |
Re: unlike MS-Windows, not all *nix machines were created equally. A 32-bit program compiled on one *nix computer may or may not run on another 32-bit *nix computer, unless the hardware is identical. There are many different flavors of linux/unix computers and they run many different chip sets (or whatever they … | |
Re: The problem you see is due the the font the editor uses. Look around the editor's menu and see if it allows you to change the font, then find a font that supports the characters you want to use. | |
Re: [URL="http://www.codeproject.com/audio/fister.asp"]Here[/URL] is one way to do it. If you google for "play sound" you will find other ways. | |
Re: look at the structure -- credit is an array of floats and you are attempting to use it as if it were a single float object. Change the structure to remove the arrays [code] struct cgrade { char course[50]; // room for 50 character course name float credit; float grade; … | |
Re: I think you are encountering what is commonly called "undefined behavior" or "implemention specific". In C, [b]const int a points [/b]to a memory location that can be modified, but in c++ variable [b]a[/b] is not located at any memory variable but just used as an immediate value, which is similar … | |
Re: The problem is classic case of buffer overrun. char i[iNumLen + 1]; The above does not allocate enough space for the result string. Boost libraries contain a regular expression c++ class. It might be worth tossing out this poort c implementation and using boost. | |
Re: where is the c/c++ programming question? Did you check to see if the caps lock key is on :rolleyes: | |
Re: Unlike most win32 api functions mapi does not have a library. Instead, you will have to learn how to use LoadLibrary() and GetProcAddress(), as explained in [URL="http://windowssdk.msdn.microsoft.com/en-us/library/ms529053.aspx"]MSDN[/URL] [quote] To use the Simple MAPI functions, compile your source code with MAPI.H. MAPI.H contains definitions for all of the functions, return value … | |
Re: MS-Windows specific -- calls them [b]file handles[/b], otherwise the concept is the same as stated previously by Rashakil. | |
Re: std::string.substr() returns another std::string.and you can't mix C and C++ like that. you would need to allocate space for the substring [code] char * str; string str2 = "hello"; string str3; str3 = str2.substr(2,4); str = new char[str3.length()+1]; strcpy(str,str3.c_str()); [/code] C isn't nearly as kind to you as c++. | |
Re: from the command prompt just redirect the output to a file [code] c:> myprog.exe >file.csv <Enter> [/code] | |
Re: [CODE] // BTW, this will eventually return a string containing the token_numth token. But I'm just trying to get it to work for now. void strsplit(const char *str, char splitchar, int token_num) { char *delimeter = "\0"; delimeter[0] = splitchar; [color=red]^^^ delimiter is a ponter that oritinally points to someplace … | |
Re: This is now the THIRD TIME I've told you that you have to [URL="http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/"]FOLLOW THESE INSTRUCTIONS[/URL] . PAY ATTENTION TO Steps 3 through Steps 5. On my computer the SDK was installed here: D:\Program Files\Microsoft Platform SDK\Lib And yes, odbc32.lib is there. Check your computer to convince yourself that the … | |
Re: The O/P you posted is wrong (the actual o/p may be slightly different from one computer to another because the second %c in the format string.) [code] char*str="∟";main(){printf(str,34,str,34);} [/code] The formatting string is the first argument to printf() -- it does not have to be a string literal and can … | |
Re: try argv[0] [code] int main(int argc, char *argv[]) { printf("%s\n", argv[0]); return 0; } [/code] | |
Re: you need to download the Windows Platform SDK because Visual C++ 2005 Express does not include it by default. Go back to the download page and you will find the link at the bottom of the page. There are also instructions on how to set up the compiler to use … | |
Re: I don't normally post complete homework solutions, but since everyone else is, here's my 2 cents worth [code] #include <iostream> using namespace std; int main() { const char str[] = "1234567891234567"; char array[5][5] = {0}; int nums[5] = {0}; char *ptr; int numindex = 0; int i, total; ptr = … | |
Re: c and c++ does not use the "then" statement as some other languages do. The next statement or block following the if statement is executed when the if statement is true. Notice the use of the double '=' symbol which is the logical equal. A single '=' means assignment. Lots … | |
Re: there is no standard naming convention that all programmers use, normally when you go to work for a software house the company you work for will have a set of standards that you must follow. Lacking that, you can use whatever you like. | |
Re: read the manual! fgetc() does not return NULL when end-of-file. It returns EOF. | |
Re: On MS-Windows os, look in C:\WINDOWS\system32\drivers\etc for hosts and services files. These two files will tell you which ports are used or available for use, but doesn't say whether they are accessible -- some may have been blocked by company policy or filewalls. *nix systems have similar files, but I … | |
Re: VC++ 2005 Enterprise, but it will cost you about $2,000.00 :eek: also, read [URL="http://web.daniweb.com/techtalkforums/thread50370.html"]this[/URL] thread | |
Re: >>and it worked fine but for some reason now it doesnt do what the program tells it to do' Yes, it does do exactly what you told it to do. But that may or may not be what you want it to do. :mrgreen: major problem is that you are … | |
Re: If it is running Microsoft Windows 2000 or XP, why can't you just install it like any other program? | |
Re: 1. do not use feof(). 2. your program is mixing binary file read with text file writes. If the file is truly a binary file then simply using fprintf() to write it to another file is not what you want to do. [code] char buffer[255]; size_t nBytes; while( (nBytes = … | |
Re: you already said you need a loop, so I suppose you know how to do that. Inside the loop you need to format the filename based on the loop counter. [code] char filename[255]; // assum loop counter is variable i sprintf(filename,"file%d.jpg",i); utput.open(filename, ios:out|ios::binary); // output] [/code] There are a couple … | |
Re: getch() returns an int, not a char. And there is an open parenthesis missing in the if condition. [code] [color=red]int c; [/color] [color=blue]if( (c==getchar())!='\n')[/color] <snip> [/code] | |
Re: my guess is that either (1) you are attempting to run a program that requires W2K or XP, or (2) the program has some bugs, possibly buffer overflows, that is causing it to scribble all over memory. | |
Re: what version of vc++? there's only a dozen or so versinos :) [URL="http://www.pcreview.co.uk/forums/thread-1872166.php"]Here [/URL]is one solution -- I have no idea whether it will work for you or not | |
Re: [QUOTE=~s.o.s~]The above statements is illegal .[/QUOTE] No it isn't illegal --I use similar constructs frequently to copy data from destination to source. Example: [code] char buf1[20]; char* p1 = buf1; char *p2 = "Hello World"; while(*p2) *p1++ = *p2++; *p1 = 0; [/code] | |
Re: > <<<<<<<<<<<Dialog.Cpp>>>>>>>> > Preview * p=new Preview(); > p->GetDC()->TextOutW(1,2,_T("rxg")); > i think add char to p; > Debug no Error,but run Error > how to add char to TextOutW function in p > > > sorry,My English isn't good > thank:) after calling new you have to call its Create() … | |
Re: Only one object and one thread can write to a file at one time. The reason should be obvious -- if two threads attempt to write to the file at the same time the result will be an unpredictible mixture of the data. You can take at least a couple … | |
Re: speed is sometimes much more important than modularity or maintainability. I worked several years on a program that had to get data real-time from barcode readers on packages as the packages moved along an assembly line. Then the program had to look-up data in a database whose key was the … | |
Re: you will have to be a little more specific about the requirements -- a "Dump tool" can mean almost anything. My interpretation would be a program that displays the contents of database tables. Yours might be something else entirely. | |
Re: just an alternate compare. qsort() doesn't care about actual values, just cares about 0, < 0 or > 0. [code] int compare (const void* source, const void* dest) { return ((List*)source)->value - ((List*)dest)->value; } [/code] | |
Re: If you know how to do file i/o (reads and writes) then the problem is pretty simple. Just open the main file for reading (binary mode) then create a series of small files (open them only one at a time) that will store XXX number of bytes. When the output … | |
Re: I know its possible to write binary files because I've done it hundreds of times, and so has almost everyone else. This works for me. [code] #include <stdio.h> #define MAX 1 typedef struct { short int key; char name[21]; char symbol[6]; float price; float high; float low; short int ratio; … | |
Re: The first place to start your research is probably [URL="http://www.google.com/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=round+robin+c+program&spell=1"]google[/URL]. It can often find answers to problems quickly, and sometimes not too. | |
Re: >>.void WriteMem(DWORD MemOffset, DWORD DataPtr, DWORD dataLen) ;{ remove the period and the semicolon. neither belong there. | |
Re: [QUOTE=joshilay]what are the features of c which are not available in c++ ???[/QUOTE] There are none. some may be implented in C++ a little differently, but they are all there nontheless. For example, c++ requires typecasting when assigning a void* object to some other kind of pointer, C does not … | |
Re: read [URL="http://support.microsoft.com/kb/196776/"]this[/URL] article if you don't mind spending a few days learning how to do Office Automation in C++. I understand its easier with .NET but I haven't tried it myself. | |
Re: [QUOTE=hollystyles]In fact the newbie posters should have the most rep giving power as they're the ones we help the most, not the old hands back slapping each other....although I don't want to put anyone off either.[/QUOTE] how about people with less than 200 posts can give or remove rep? That … | |
Re: who said you can't make a pointer to a reference? [code] void foo(int& x) { int* p = &x; *p = 0; } [/code] If that is not what you mean then please post an example. |
The End.