15,300 Posted Topics

Member Avatar for tformed

you can not use switch with strings. >>word = getchar(); Don't use getchar() is c+++ programs. use cin.get() instead.

Member Avatar for Killer_Typo
0
4K
Member Avatar for TheGathering

My first program in 1979 was in HP Basic on a HP computer that had a wapping 64K memory and used 8 Inch (203 mm) diameter glass diskettes to store data. A couple years later we also got a TI 99 programmable calculator that was pretty nice for the time.

Member Avatar for jbennet
0
133
Member Avatar for RohitSahni

>>where can i get STL string user guide [URL="http://www.cppreference.com/cppstring/index.html"]here[/URL] use transform() to convert a string to upper or lower case, like this: [code] #include <algorithm> #include <string> <snip> std::string str = "Hello World"; std::transform(str.begin(), str.end(), str.begin(), ::toupper); [/code]

Member Avatar for Ancient Dragon
0
110
Member Avatar for mauro21pl

>>How may I clear whole array in that example code a constructor and use memset() to clear it. Line 3: conio.h is non-standard file that contains non-standard functions. You don't need it in the code you posted because there are c++ alternatives that are standard -- such as cin.ignore().

Member Avatar for Ancient Dragon
0
84
Member Avatar for jaepi

>>what do you think will happen to the values of x, y and z? why don't you just compile and run the program then you can find out for yourself instead of guessing.

Member Avatar for jaepi
0
99
Member Avatar for Elfshadow

It might also depend on how the compiler implemented cout. Microsoft compilers cout is just a thin wrapper for printf(), that is, both cout and printf() call the win32 api function WriteFile(). I have no idea how *nix compilers implement the two functions.

Member Avatar for jwenting
0
127
Member Avatar for kxh29

can't you just translate that shell program into c? That is, write a c program that makes the same system calls ?

Member Avatar for TkTkorrovi
0
122
Member Avatar for jamello

Happy Birthday all you July babies :) I'm February, but my 45 wedding anniversery is today 17 July.

Member Avatar for Serunson
1
140
Member Avatar for shuaibe

1. Just parse the string. If you already know the time format then it is not very difficult to split the string into its individual parts (hours, minutes, seconds, milliseconds). 2. The milliseconds is not very useful when the time difference is greater than probably one minute. If the difference …

Member Avatar for Ancient Dragon
0
101
Member Avatar for SHWOO

My guess is that you do not have the list of directories set up correctly in the compiler IDE. Look at menu Tools --> Options --> Project and Solutions --> C++ Directories and make sure the path to the include directories are correct and includes the path to where you …

Member Avatar for Ancient Dragon
0
107
Member Avatar for maeveh

Yes, and its very very complicated. I doubt you will gain anything by doing that, but will probably slow down the program even more because you are adding yet another layer. Probably C# or VBA would be better languages for that.

Member Avatar for Ancient Dragon
0
86
Member Avatar for M1A1

I think you have to compile the boost libraries before you can use any of them. Did you read the readme and install files?

Member Avatar for M1A1
0
120
Member Avatar for hitesh_mathpal

[QUOTE=dr4g;404288]Code not tested, but see no reason why it shouldn't work. :) Cheers.[/QUOTE] Agree it should work but not the way the OP intended because it does not allow for variable number of arguments.

Member Avatar for TkTkorrovi
0
205
Member Avatar for sadaka

The most common, and recommended, way of coding the message loop is like below, which was generated by VC++ 2005 Express when I created a windows project. Note that it is not necessary to use a break at all. [code] // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { …

Member Avatar for ProgrammersTalk
0
164
Member Avatar for phalaris_trip

is [URL="http://www.daniweb.com/forums/thread37591.html"]this[/URL] what you are looking for ?

Member Avatar for phalaris_trip
0
229
Member Avatar for christina>you

Never hear of him, but [URL="http://www.youtube.com/watch?v=sBQLq2VmZcA"]this looks good[/URL]

Member Avatar for hbk619
0
794
Member Avatar for jdenver
Member Avatar for UrbanKhoja
2
108
Member Avatar for tiyagu_vpm
Member Avatar for bapef

[QUOTE=krnekhelesh;402518]Can't you instead use gets() function?[/quote] No -- gets() is C not C++ and its terrible to use in C code too.

Member Avatar for bapef
0
3K
Member Avatar for sk8ndestroy14

And one senitor from the state of MA who I will not mention by name should have been jailed for manslaughter some 30+ years ago.

Member Avatar for sk8ndestroy14
0
257
Member Avatar for JRM

Lines 1 and 2 only allocate one char of memory. Any attempt to use strcpy() on either pointer will normally cause memory corruption because strcpy() adds a '\0' to the end of the string that it copies. Line 4 will most definitely corrupt memory because you told getline() to accept …

Member Avatar for Narue
0
144
Member Avatar for Dave Sinkula

[QUOTE=jbennet;401263]What is jaywalking? - and why s it illegal?[/QUOTE] I have not heard of anyone getting so much as a ticket for many years, but a google search showed [URL="http://blog.lewrockwell.com/lewrw/archives/012025.html"]this recent arrest[/URL]. And another version of the same arrest[URL="http://www.townhall.com/columnists/MaryGrabar/2007/01/14/arrest_all_jaywalking_history_professors"] here[/URL].

Member Avatar for jbennet
0
320
Member Avatar for ralphie82mM
Member Avatar for ralphie82mM
0
99
Member Avatar for radskate360

>>while (!infile.eof()) This is wrong -- don't use eof() because it doesn't work the way you would think it should. Here is a better way of doing it [code] while( infile >> name) { } [/code] >>if (i < name.length()) In your code the value of i (which you initialize …

Member Avatar for iamthwee
0
170
Member Avatar for gattispilot

>>There are if start=1 statements Please post that exact code -- what you posted is an assignment statement, not a boolean logic statement. use == instead of = to test if start is or is not 1. C, C++ and C# require two equal symbols to test for equality, VB …

Member Avatar for Ancient Dragon
0
96
Member Avatar for Matt Tacular

>>int y = str[i2]; str[i2] contains the ascii value of the character, such as '1' is ascii value 49. See [URL="http://www.asciitable.com/"]this ascii chart[/URL] for all of them. To convert it to decimal just subtract '0' [inlinecode]int y = str[i2] - '0';[/inlinecode] >>a += (h_str[h_str.length() -i2]) *x; I have no idea …

Member Avatar for hinduengg
0
105
Member Avatar for gattispilot

line 2 in your first code snippet: use the boolean == operator instead of the assignment = operator. lines 4-7 -- you need to use braces "='{' and '}' in order to put lines 5-7 inside the else block on line 4. In the second code snippet its difficult to …

Member Avatar for gattispilot
0
198
Member Avatar for parthiban

The default class constructor is always called then the c++ class object is declared (except as noted below), for example on line 25 of the code you posted. On line 29 the class's operator= method is called, not the class constructor. The second example you posted works the same way …

Member Avatar for Bench
0
114
Member Avatar for m_meena

The function that is being called requires wchar_t* instead of char* when compiling a program for UNICODE. Typecasting will not make the conversion. Instead you should be using the macros provided in tchar.h to make the conversion. when compiling for UNICODE all character string literals need to be surrounded with …

Member Avatar for Ancient Dragon
0
56
Member Avatar for aasi007onfire

If you wrote both programs then you could use (1) Clipboard, (2) Pipes, (3) sockets (4) COM objects. The simplest to implement is the clipboard. If you would tell us more detailed information such as (1) did you write both programs (2) if not then how does the program save …

Member Avatar for bvgsrs
0
95
Member Avatar for driplet

I don't think CListBox has a method to move a row from one spot to another. If you want to change the order of the items then I'd probably copy them all into a std::vector<std::string>, sort the vector however you want, delete everything from the list box, then copy the …

Member Avatar for WolfPack
0
548
Member Avatar for Ancient Dragon

Lady Bird Johnson, widow of former US President Lyndon B. Johnson died today at age 94. Her lagecy was to rid our interstates of billboard proliferation and planting wild flowers along hiways/interstates. That is the most any First Lady has done since her time. We in USA are all better …

Member Avatar for christina>you
0
47
Member Avatar for bluebird

[URL="http://www.difranco.net/cop2220/op-prec.htm"]Why don't you just look it up ?[/URL]

Member Avatar for Salem
0
200
Member Avatar for mauro21pl

Can't help you because we can't see your monitor -- too far away from where I am sitting :-/ So if you want any help you will just have to post code, and please use code tags.

Member Avatar for Ancient Dragon
0
74
Member Avatar for gopi kannan

[QUOTE=Nichito;401935] arrays are transferred by value to a function,[/QUOTE] Not really -- only the pointer is passed by value, all data is passed by reference, that is, the data is at the same address location in both the calling and called functions. You can not pass array data by value …

Member Avatar for ndeniche
0
84
Member Avatar for complete

The CWinApp-derived class contains a list of CDocTemplate objects. You can iterate through that to find the pointer to CDocument class. From CDocument iterate through the list of CView classes that are attached to the document. I know this seems a long way around to get to the CView class …

Member Avatar for Ancient Dragon
0
109
Member Avatar for complete

Microsoft did away with the Class Wizard that was in VC++ 6.0 and replaced it with Properties windows. In ClassView right-click a view and select Properties from the popup menu. Or if you have a dialog box displayed right-click a control and select Properties. If you want to create a …

Member Avatar for Ancient Dragon
0
174
Member Avatar for kodiak

I think you will have to avoid system() wherever possible because some commands such as [b][i]set[/i][/b] won't work correctly.

Member Avatar for kodiak
0
116
Member Avatar for orion_nsk

I would think that would be next to impossible to do without knowing the commands to send to the web site since every web site is different. You'd probably have to download the page that contains the user id and password edit boxes, parse it, and pass back whatever it …

Member Avatar for orion_nsk
0
82
Member Avatar for Ancient Dragon

Going to Ankeny Iowa (about 20 miles North of Des Moines) tomarrow for a 45-year high school class reunion (class of 1962). Our high school was consolidated in 1957 from five surrounding schools. My sister (class of 1958) will also be attending -- I haven't seen her for about 10 …

Member Avatar for Ezzaral
0
89
Member Avatar for jamello

[QUOTE=Aia;397789] [/B][/I]Oh, my..., :icon_redface: I feel a little shameful of myself. I think I have gone too far. [Edit] This exercise was conducted with insulting purposes only. If a moderator feels the need to censure it. I certainly will understand.[/QUOTE] Its all gibberish -- you might as well have written …

Member Avatar for jamello
0
472
Member Avatar for dotcom123
Member Avatar for mattyd
Member Avatar for gaasha
0
1K
Member Avatar for Firestone
Member Avatar for WaltP

The only reason to monitor rep comments is to filter out objectional language and the language filter should do that. Otherwise I could care less about the comments, other than to read them and possibly find out any problems I may have caused.

Member Avatar for peter_budo
1
1K
Member Avatar for ECETiger

when you [URL="http://heim.ifi.uio.no/~stanisls/helppc/int_16.html"]invoke int 16[/URL] the key is stored in the al register. You must save it someplace else if you need it later. [URL="http://support.microsoft.com/kb/q60140/"]The standard keyboard buffer[/URL] can contain a maximum of 32 characters and its address is at 0x0000:0x041E. >>perform something similar to a scanf function in assembly …

Member Avatar for mytime19
0
103
Member Avatar for pixrix

[QUOTE=Killer_Typo;398906] so all C code should compile in a C++ compiler. [/QUOTE] No it won't. C++ made several syntax changes such as c++ requires type casts where C does not. [URL="http://david.tribble.com/text/cdiffs.htm"]Here is a more complete list of differences[/URL]. One way to make your code more c++'ish is to replace all …

Member Avatar for ~s.o.s~
0
298
Member Avatar for rizkulhan
Member Avatar for AtomicProGS9

Use FindFirstFile() and FindNextFile() to get the list of al the files that need to be deleted. Look in the [URL="http://www.daniweb.com/code/snippet370.html"]c++ code snippets [/URL]and you will find example code. Once you get that going then you can figure out how to program the [b]delete[/b] button.

Member Avatar for dougy83
0
119
Member Avatar for Ancient Dragon

why do I get the message in [URL="http://www.daniweb.com/forums/thread77423.html"]this thread[/URL] that I must activate my membership before I can contribute ?? Does everyone get that message when viewing closed threads ?

Member Avatar for jbennet
0
238

The End.