15,300 Posted Topics
Re: A rottweiler dog so that I can teach pesty neighbors a few lessons. Superpowers: jaws of steel. | |
Re: First thing is that you need a list of the items for sell and quantities on hand. You might have something like this: [code] class item { std::string name; std::string upc_number; // prodct it, or barcode int quantity; float price; }; [/code] Now create a vector of those for each … | |
Re: The short answer it No -- not with scanf(). scanf() will stop processing keyboard input when the first non-digit is reached or when no more charcters in the keyboard buffer. That function does no error checking. | |
Re: lines 1 thru 7: remove the semicolons at the end of those lines The compiler vc++ 2010 express produces a lot of warnings about double to int and vice versa conversions. You should treat all those warnings as actual errors because they can often cause problems. After making appropriate typecases … | |
Re: looks like it is calling a function to see if two strings are equal or not. | |
Re: Maybe you need to explain the problem a little more. The way I do it is to look at the monitor. | |
Re: He was banned not for what he said to and about me, but for spamming all the forms on PFO with a post nearly identical to this one. And I closed his threads to avoid pissing contests and/or flame wars, which is where those threads were headed. Up until he … | |
Re: Read through [URL="http://winprog.org/tutorial/"]this tutorial [/URL]-- it will teach you all the basics. | |
Re: >>long some_long = (long)&foo[6]; I think that's called undefined behavior, typecasting an address into a long integer. The two may or may not be the same size, depending on the compiler you are using. The way I would do it is like this: [icode]long some_long = *(long *)&foo[6];[/icode] | |
Re: ShellExecute() or CreateProcess(). Which to use depends on how much control you want over how the new process is created. Once the program is compiled it doesn't matter what language it was originally written in. The original language is lost in *.exe programs. | |
Re: >>Am doing migration from 16 bit code to 32 bit... help me to solve the issue... There were some very major changes to MFC between the two versions. Which 32-bit version of the compiler are you using? I hopt it will be vc++ 2010. Look up the function [URL="http://msdn.microsoft.com/en-us/library/sa2c737c(v=vs.80).aspx"]GetFirstDocTemplatePosition[/URL]() and … | |
Re: >>So,question is,how do i set a struct to null? In an array, you can't. One way to do it is to add a deleted flag to the structure and set it to true if the struct is to be considered deleted. Another option is to set the first byte of … | |
Re: If you don't want to be a member of DaniWeb then just simply stop posting. It isn't any easier than that. | |
Re: Yes, it is true that the compiler produces 32-bit code, but that should not have been the problem. I also have 64-bit Windows 7 and never have a problem using 32-bit DLLs. What version of VB are you tring to use? | |
Re: >>1. i already have ("CLS") and ("cls") ( both of them but i do not know whats the difference) . CLS and cls are the exact same thing. MS-Windows does not distingish between cases line *nix does. >>will this cls duo make any problem for a 3rd one what 3d … | |
Re: line 37: use == operator, not = operator. That is setting those variables to 0. | |
Re: It might be nice to have a thread that contains all the featured posters and the articles written about them. Sort of like a history book of featered posters. As it is now its not possible to read the intervies. Say I wanted to re-read SOS's interview -- not possible … | |
Re: >>I get an error whenever I try to run it. What was the error? >>x = (int*)malloc(length*4); what makes you think the size of an integer is 4??? Maybe it is, and maybe it isn't. The size of an integer depends on the compiler you are using. A more portable … | |
Re: First thing to do is design the database. What will it contain for each customer? How will it be written -- binary or text ? I assume you want to just use a standard file instead of an SQL compliant database, such as MySQL or MS-Access, which would be overkill … | |
![]() | |
Re: If you use MinGW then [URL="http://www.velocityreviews.com/forums/t287965-static-linking-of-c-libraries-with-gcc-g.html"]this thread[/URL] may help you. Go to project options, linker tab, and add -static flag. But that flag didn't seem to make any difference with my small test program. >>tell me a way to link to the .dll files I need without having them directly … | |
Re: One way to do it is to check the agent array to see if it already contains an entry for the agent just read in from the file. If it already exists then just sum the sales and value into the respective sales and values column. something like this: [code] … | |
Re: why don't you ask QT? [URL="http://qt.nokia.com/"]Join their mailing lists[/URL]. But my guess is that you can't because QT is cross-platform. If they added .NET support then it wouldn't be cross-platform any more. | |
Re: How much assembly do you already know? Its really probably not all that hard to do. You need to declare storage for four variables, a, b, c and d. First calcaulate c^2 (which is just c * c), and d^2 (d * d). store that result away somewhere. Then calculate … | |
Re: The problem is not related to atoi(). [code] static int getdigit( int num, int position ) { int digit = num / (int)pow(10,position-1) % 10 ; return digit ; [/code] division by 0 problem. pow() is returning 0 probably because the second parameter to pow() is a negative number (the … | |
Re: You seem to have your head together and are doing the right things. Stay in school and get a bachelor's degree from a 4-year college or university. Programmers today are a dime a dozen and you need to make yourself stand out from the crowd. Getting a 4-year degree will … | |
Re: You can open the stream in both input and output modes -- just use the | or operator [icode]fstream file("text.txt", ios::in | ios::out);[/icode] | |
Re: The problem is that the toolstrip objects in Form1 are declared private. Form2 will be unable to view them without a public function in Form1 that will expose their contents or check status. Write a public method in Form1 that returns the check status of a menu item. | |
Re: If you know how to use linked lists you would be better off with a linked list of lines than that very huge array of strings. Something like this [icode] struct node { struct node* next; char line[255]; }; [/icode] Since this is c++ you could use std::vector instead of … | |
Re: The parameters in function you posted for "what I have so far" must match exactly the parameters of the function prototype. In otherwises, the function prototype are double[], int, and int. Yours is double[], double[] and double; Not the same, one of the two is wrong. | |
Re: Your link wants me to download and install some unknown rar file on my computer. Ain't going to happen in this lifetime. If you want us to see the instructions you were given all you hve to do in attach the text file to your post using the Advanced Editor … | |
Re: That makes three of us, almost. I live about 30 miles from that town. | |
Re: [URL="http://www.cplusplus.com/reference/clibrary/cstdio/vsprintf/"]This link [/URL]has an example of how that function works. If you know how sprintf() works then you're nearly home with vsprintf(). Then if you read [URL="http://www.cppreference.com/wiki/io/c/snprintf"]this thread[/URL] you will see that the second parameter to vnsprintf() is the number of characters in the buffer. When compiled for UNICODE sizeof(TCHAR) … | |
Re: MySQL is very popular. But I don't know what you mean by "light". Its either SQL compliant or it isn't. I also don't know about its ability to recover after a crash. Since its so popular I can only assum that it can do it. | |
Re: line 31: The sizeof(a) will not give you the number of rows in the array. What you want is to use the already defined macro SZ that appers on line 3. How to increment: (*a[i])++; | |
Re: you only have 30 minutes to edit a post. After that you will either have to make another post to correct errors in the previous post, or report the post (hit the Flag Bad Post button) and explain what you want the mods to change. Whether they will change it … | |
I'm trying to find the code snippets I have posted -- it why is to do damned difficult? There used to be a link to our code snippets but its gone now. I tried advanced searched, enter my name in user id block, selected code snippets, then hit the search … | |
Re: Are you required to use inline assembly for this program? It's so simple in C, why do it the hard way??? [icode]printf("what is %s and where is %s", argv[1], argv[1]);[/icode] In any event, you need to use a loop to copy the characters, or you can set up the call … | |
Re: Everyone will just ignore you when you use such cursing. | |
Re: The command-line compiler is cl.exe. In a command prompt window (DOS box), first run vcvars32.bat found in the compiler's install bin directory. That will set all the environment variables needed to run cl.exe cl.exe uses many of the flags that are commonly found in make files. /I followed by include … | |
Re: Did you try [URL="http://lmgtfy.com/?q=c+compilers+for+microcontrollers"]google[/URL] | |
Re: That's a very very broad subject and could probably write a whole book about it. Re-think it like this: how does the policies of your school affect you? Basically the boss will tell you "Follow my policies or else -- if you don't like them then go work somewhere else." … | |
Re: >> The file names are specified on the command line: That means you need to declare main() with two arguments -- argc and argv. argv[1] is the input file name and argv[2] is the output file name. Your program should not prompt for these names. >>cout << "Enter <strong class="highlight">the</strong> … | |
Re: My guess is that you have not even attempted to compile that code. It contains errors that you need to fix. For example: CMyMessage line 77: error -- you can not store a pointer in one byte of memory. | |
Re: Finally someone had enough smarts to know what a RAM disk is. I suspect only us older people have ever heard of it because its only supported on 16-bit MS-DOS operating system, which used randrive.sys file at boot time. AFAIK they can not be created in 32 or 64-bit os. … | |
Re: Yes I think its misplaced thinking. What if there are no items in the queue, and reader tries to read while writer tries to write? Everyone needs to be locked out while writer tries to write to the queue. Depending on how your code is written there could be more … | |
Re: why are you calling GetName() so many times??? And for what purpose is the second parameter to that function? [code] char* xxx = GetName(); if( xxx != NULL) { printf("%s\n", xxx); memcpy(message+1,xxx,strlen(xxx)); } [/code] | |
Re: count them in a loop. Now post the code you have written if you have more questions. | |
Re: what's the value of es when that function is entered? The screen address is at 0xB800:0000, so you have to read starting from there. I think your function needs to set the value of es and not assume it already contains the correct segment value. bx = upper left corner … |
The End.