15,300 Posted Topics
Re: Write a Windows Form application and problem solved. | |
Re: an instance of an object is created when a variable is declared. Declaration of a symbolic name just defines a name that can be used in a program. [code=plain] int muthu1208; // an instance of an object #define MUTHU 25 // definition of a symbolic name [/code] | |
Re: Instead of creating an instance for each city you can just create an array of those structures. for example [icode]struct Cyprus cities[4];[/icode] How to populate the array may depend on the instructions your professor gave you. My guess is that your program should read the data from a text file, … | |
Re: We are not here to write your program for you, but we will help you if you show some effort, such as post the code you have already written. | |
Re: You have already almost written it yourself. Groups are done on queries, not updates. [code] UPDATE table SET test4=1 WHERE (test1=1 and test2=1 and test3=2) OR (test1=1 and test2=2 and test3=3) OR (test1=1 and test2=3 and test3=0) OR (test1=1 and test2=4 and test3=1) [/code] | |
Re: There are several ways to do it but the oldest and most widely used is ODBC. ggogle for "ODBC tutorials" and you will find out how to do it. It's a lot more complex than in VB, so be prepared for a lot of coding and trials. You might find … | |
Re: First create an instance of the structure then populate each PERSONAL structure, for example to populate the first PERSONAL structure [code] PERSON person; strcpy(person.individual[0].name,"Tom"); [/code] | |
Re: There is a third parameter to std::sort() which is the name of a comparison function that you will write. That is not necessary if you have a vector of standard data types, such as int, double and std::string. Anything more complex such as a c++ class that you created will … | |
Re: you have the [b]val[/b] declared twice -- once on line 1 and again on line 3. You can not use the same variable name twice like that. line 4: you have to call strcpy() to do it: [icode]strcpy(var[0],"ANS");[/icode] The = assignment operator will not work on character arrays. | |
Re: Where is the *.cpp file that contains main()? Check your project files to make sure one of the *.cpp files contains that function. You said you created an empty project -- my guess is that you forgot to add main() | |
Re: Its simple to create yourself. call win32 api function SetTimer() and have it called every 1 second. Inside the event function that you have to pass to SetTimer() do whatever you want to display the time. | |
Re: >>I've seen a few posts on here talking about "databases" as if they were just files Yes, database is a very broad term that describes everything from a simple text file to the most comples SQL databases such as MySQL. >>I googled and found sqlapi++, is that the best way … | |
Re: add [icode]#include <windows.h>[/icode] before mmsystem.h you may need to turn off UNICODE -- select menu item Projects --> Properties (the last menu item), expand the Configuration Properties tab, select General, then on the right side of the screen, third item from the bottom, change Character Set option to Not Set. | |
![]() | Re: 1. Read the lines into a vector of strings 2. When a line is read, search the vector to see if the line already exists. If it does then just add the quantity to the string that was found. If not then add the new string to the end of … ![]() |
Re: You will want to include <fstream> and use ifstream's getline() function. | |
| |
Re: >>CString str=(_T(buffer)); The _T macro only works with string literals, not character arrays. For example [icode]_T("Hello")[/icode] If you want to convert a character array from char* to wchar_t* you have to use one of the convertion functions. [URL="http://msdn.microsoft.com/en-us/library/ms235631(VS.80).aspx"] Here is a thread [/URL]that will show you how to do that. … | |
Re: Almost nothing written since 1960. Singers nowdays just make noise, not music, although they have gotten a little better in the last 5 years. what is your favorite job? | |
Re: You are going to have to explain what you want a whole lot more. Do an interface to or for what??? | |
Re: redeclare [b]values[/b] as [b]unsigned char[/b] instead of [b]int[/b]. Then your program will most likely display the data the same as your hex editor did. You did not post the code you tried to get the last 100 bytes. | |
I just discovered that when I hover my cursor over a word a popup window shows the word in several languages. At least that's what I think its doing. Is that DaniWeb doing that or something else? I never noticed that before. I'm beginning to think that maybe its IE8 … | |
Re: why are you using character arrays instead of integers? why are you using C's gets() function instead of c++ cin? If you really really want to use character arrays then you need to make them larger -- you have to account for the string's NULL terminating character. With integers you … | |
Re: How to read from a text file depends on what you want to read. If you want to read an entire line at a time then follow Aia's example, but be aware that fgets() might put the '\n' at the end of the string, if one is found in the … | |
Re: FOUR: If you want your code to be portable across operating systems and even compilers then don't do it in assembly. Assembly language is not portable. And inline assembly may not be portable between different compilers. Most C and C++ compilers today are smart enough to do a better job … | |
Re: You have five options that I can think of right off-hand. How much effort you want to put into it depends on your goals -- just to satisfy a student course requirement or do you want to implement it on-the-job. Will it be just a one-time project, or are you … | |
Re: You need to post code. >>is usable outside of that function Not necessarily. Depends on the code and how you pass the pointer between the functions. There are several ways to do it so we'd need to see you you tried to do it. | |
Re: use getline() instead of >> operator and it will work [code] int main() { string serial = "0"; while(serial != "") { cout << "Please enter serial number:" << endl; getline(cin,serial); } cout << "All done\n"; } [/code] [edit]Oops! didn't see Nathan's reply [/edit] | |
Re: [code=cplusplus] if( this is true) // comments here do_something(); [/code] if, this and true should also be blue. | |
Re: [QUOTE=sdinu96;1230123]{ int i = 25789; char *p; .............. .............. printf("%d",*p); /* (*p) should give in printf*/ } dont assign p=i ............apart from this how we can typecast this program so that we can get interger value tp pointer p.............please help me this[/QUOTE] This might work: [code] int i = 25789; … | |
Re: Put a breakpoint somewhere in your program to prevent it from closing. There should be an icon on the taskbar that you can click to restore the console window where the error message is. | |
Re: >>Whenever I attempt to run this program, Since you are new -- you did not [b]run this program[/b], but you [b]compiled[/b] this program". If you are going to learn programming then you need to also learn programming jargon. "run a program" means the program is already compiled and you can … | |
Re: I just upgraded and I don't really see any difference, other than there is now a button to open a new tab, like IE8 has. | |
Re: [QUOTE=cscgal;1225103]Can everyone PLEASE stop incorrectly using the Quote tags on purpose. It makes things MUCH more confusing. Just do for heaven's sake. Grr.[/QUOTE] How is hitting the "Post Reply" button using quotes incorrectly? ![]() | |
Re: >> and also uses EncryPro for encrypting customer ID. In USA customers do not have IDs. Only the cashier logs into the cash register with a user name and password, then he/she starts processing customers, checking/scanning each item, finally receives the money in the form of cash or check or … | |
Re: >>Go over the string and count spaces Generally, yes, but you also have to check if words are separated by more than one white space (spaces or tabs). When a white space character is encountered you have to increment the loop counter until the first non-white space character or end-of-string … | |
Re: Why not? You see child windows with buttons etc. all the time, just look at your browser to see them in action. If you use FF or IE7/8 each of those tabs are just child windows. You might want to investigate either CLR/C++ (Midrosoft Forms) or C# which will make … | |
Re: >>The program works No it doesn't. you use gets() all over the place. Try entering some text that is longer than the buffer can hold and you will find that your program doesn't work afterall. gets() will just scribble all over memory with the extra characters and cause your program … | |
Re: >>assignment makes integer from pointer without a cast I don't get that error when I compile it with vc++ 2008 Express. | |
Re: There are a number of ways to do it. One way is to use strtok() to find each segment of the string. | |
Re: There is no reason for such a forum. How may people have posted questions on DaniWeb about mobile? I suspect next to 0. Dani won't add new forums unless there is a clear and large demand for one. One person (you) does not a large demand make. | |
Re: That is a compiler-specific function implemented mostly in *nix. But if you google for it you will find the first two links show you how to use it. | |
Hover your mouse over the [noparse][ICODE][CODE][/noparse] tags on [URL="http://www.daniweb.com/forums/post1221606.html#post1221606"]this thread[/URL] and you will see a popup with the otherwise hidden code that the OP instended to post. It can only be viewed, it can not be otherwise copied to the clipboard. | |
Re: >>I need to take 2 char strings (6 character date) (and (8 charachter operatror id) convert to uin32 Are you talking about converting from ansi to unicode strings? e.g. from char* to wchar_t* ? [URL="http://www.codeguru.com/forum/showthread.php?t=385375"]Here is [/URL]a 4-year-old thread, but still relevant. | |
Re: [icode]printf("%d\n", *p.i);[/icode] You have to use the * operator to print the value that i points to. | |
Re: If you want the data displayed on the console sceen then pass cout like this: [icode]cust.displayLabel(cout);[/icode] | |
Re: One way to do it is to print each byte one at a time in a loop. %s is for null terminated strings. What you apparently have is a binary file, not a text file. There is no standard C function that will print that entire buffer the way you … | |
Re: Ok, so now instead of saying See Post #5 we can say See Post #post1221433. And where did the Quote link go??? I'm using IE8 and don't see any way to quote someone. I know there's got to be a way to do it, but whatever it is it's sure … | |
Re: 1) I like the new ribbon at the bottom that contains MFF Today's Posts etc. Problem is once you click on MFF there is no way to remove the popup menu. 2) I liked the old color scheme better than this purple -- but we'll get used to this one. … |
The End.