15,300 Posted Topics

Member Avatar for jp071
Member Avatar for muthu1802

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]

Member Avatar for Ancient Dragon
0
190
Member Avatar for frag

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, …

Member Avatar for JohnSmith12
0
133
Member Avatar for tuse
Member Avatar for adonay alex

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.

Member Avatar for NathanOliver
-4
163
Member Avatar for ashar5

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]

Member Avatar for Ancient Dragon
0
130
Member Avatar for JKARIUKI

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 …

Member Avatar for Ancient Dragon
0
174
Member Avatar for Savage221

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]

Member Avatar for karthikeyans
0
270
Member Avatar for rootchord

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 …

Member Avatar for rootchord
0
640
Member Avatar for gkaykck

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.

Member Avatar for gkaykck
0
94
Member Avatar for yongj

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()

Member Avatar for yongj
0
98
Member Avatar for new2programming

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.

Member Avatar for Ancient Dragon
0
66
Member Avatar for daviddoria

>>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 …

Member Avatar for tesuji
0
235
Member Avatar for chrisdod

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.

Member Avatar for Ancient Dragon
0
113
Member Avatar for iamthwee

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 …

Member Avatar for iamthwee
0
281
Member Avatar for mimis
Member Avatar for Ancient Dragon
0
120
Member Avatar for darkdai
Member Avatar for Choink23
Member Avatar for challeng

>>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. …

Member Avatar for challeng
0
311
Member Avatar for eXceed69

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?

Member Avatar for reach_yousuf
-1
5K
Member Avatar for comput scince

You are going to have to explain what you want a whole lot more. Do an interface to or for what???

Member Avatar for comput scince
0
89
Member Avatar for tenix

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.

Member Avatar for tenix
0
8K
Member Avatar for Ancient Dragon

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 …

Member Avatar for Ancient Dragon
0
66
Member Avatar for anuragcoder

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 …

Member Avatar for anuragcoder
0
219
Member Avatar for rajsharma_85

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 …

Member Avatar for Narue
0
206
Member Avatar for supidProgrammer

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 …

Member Avatar for supidProgrammer
0
199
Member Avatar for shereefatef

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 …

Member Avatar for nbaztec
0
273
Member Avatar for cokaznsyco72

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.

Member Avatar for Ancient Dragon
0
84
Member Avatar for daniel88

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]

Member Avatar for daniel88
0
106
Member Avatar for vb5prgrmr

[code=cplusplus] if( this is true) // comments here do_something(); [/code] if, this and true should also be blue.

Member Avatar for vb5prgrmr
0
155
Member Avatar for sdinu96

[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; …

Member Avatar for Ancient Dragon
0
88
Member Avatar for sophie.c

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.

Member Avatar for sophie.c
0
207
Member Avatar for Leontyne

>>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 …

Member Avatar for olejarskiw
0
155
Member Avatar for tonis

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.

Member Avatar for jaikanth123
2
309
Member Avatar for jephthah

[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?

Member Avatar for diafol
3
1K
Member Avatar for anuragcoder

>> 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 …

Member Avatar for anuragcoder
-1
386
Member Avatar for sgriffiths

>>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 …

Member Avatar for jephthah
0
270
Member Avatar for cecp

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 …

Member Avatar for cecp
0
226
Member Avatar for ellenski

>>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 …

Member Avatar for kvprajapati
-4
298
Member Avatar for oracle123

>>assignment makes integer from pointer without a cast I don't get that error when I compile it with vc++ 2008 Express.

Member Avatar for Aia
0
749
Member Avatar for javedkhan0258

There are a number of ways to do it. One way is to use strtok() to find each segment of the string.

Member Avatar for Aia
0
470
Member Avatar for SherifSharkawy

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.

Member Avatar for SherifSharkawy
0
321
Member Avatar for javedkhan0258

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.

Member Avatar for jephthah
-1
158
Member Avatar for Ancient Dragon

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.

Member Avatar for jephthah
0
304
Member Avatar for jskelly

>>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.

Member Avatar for UncleLeroy
0
188
Member Avatar for ayushi agarwal

[icode]printf("%d\n", *p.i);[/icode] You have to use the * operator to print the value that i points to.

Member Avatar for jephthah
0
101
Member Avatar for yongj

If you want the data displayed on the console sceen then pass cout like this: [icode]cust.displayLabel(cout);[/icode]

Member Avatar for mitrmkar
1
166
Member Avatar for yuvaraj.tr

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 …

Member Avatar for jephthah
0
80
Member Avatar for vb5prgrmr

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 …

Member Avatar for vb5prgrmr
0
608
Member Avatar for jephthah

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. …

Member Avatar for Dani
8
2K

The End.