15,300 Posted Topics

Member Avatar for Buttacup

You don't call [b]new[/b] to allocate COM pointers. Call [URL="http://msdn.microsoft.com/en-us/library/ms686615%28VS.85%29.aspx"]CoCreateInstance[/URL]()

Member Avatar for Buttacup
0
133
Member Avatar for pinsickle

I like the second example better, but delete line 14. Of course it won't work if you need to know the value of [b]m[/b] after the loop terminates.

Member Avatar for Ancient Dragon
0
103
Member Avatar for lionaneesh

>>Examine this program? Tell me its bugs Well, all you have to do is run it several times and you will find out the bugs.

Member Avatar for Ancient Dragon
0
120
Member Avatar for B00t3r

The Ctrl+] key (same unshifted } key ) can be used to find matching { and }, ( and ) or [ and ]. Is that what you are talking about?

Member Avatar for strmstn
0
136
Member Avatar for ChrisXxX

Depends on whether its of type float or double. Floats are "%f" but doubles are "%lf". I think long doubles would be "llf", which is a little like long long int (64-bit integers).

Member Avatar for Ancient Dragon
0
98
Member Avatar for mikabark

>>But it does not operate well. What exactly does that mean? lines 23-31: If the return value is -1 then the program prints an error message and continues to process as if the return value were ok ??? That's a little like when chopping an onion, you accidentally chop off …

Member Avatar for Ancient Dragon
0
383
Member Avatar for juuuh333

what operating system, what gui, what compiler ??? We need a whole lot more information that what you have provided.

Member Avatar for juuuh333
0
611
Member Avatar for Rmitboy

All you have to do is print the lines on the screen. You don't have to insert anything into the actual text. in a loop from 0 to length of line, print one character, increment a count. If the counter == maxlength, print '\n' and reset the counter back to …

Member Avatar for Adak
0
132
Member Avatar for restrictment

lines 26 and 36: >> for(x=1;x<265;x++) Why are you hard coding the number 265 here? Just read the file until end-of-file is reachec [code] while( x < 255 && fromfile.getline(question[x], 255) ) { ++x; } [/code] You would be better off using an array of std::string objects instead of those …

Member Avatar for david.k
0
176
Member Avatar for Valdemar009

Are you talking about the c language itself or console program window ? The problem has nothing to do with c language. Even if you run cmd.com to get a console window then maximize it, the window may not cover the entire monitor canvas, depending on the pixel settings you …

Member Avatar for jephthah
0
162
Member Avatar for Superfreak3

Assuming the buffers contain binary, not string, data -- create a third buffer that is large enough to hold both the first and second buffers, e.g. [icode]char buf3[2048];[/icode] Then use memcpy() to copy each of the two original buffers into the third buffer. If the two buffers actually contain null-terminated …

Member Avatar for Superfreak3
0
122
Member Avatar for ganesanronaldo

You have to be careful of lines like this: while(myStack->data[top]!='(') [b]top[/b] is not a variable, but a member of the STACK structure. So you need to write it like this: myStack->top. You have that same error several times. >>push(&myStack, symbol); variable myStack is already a pointer, so remove the & …

Member Avatar for ganesanronaldo
0
146
Member Avatar for dchunt

you can execute other programs with the system() function or with several os-specific api functions. For MS-Windows it might be either ShellExecute() or CreateProcess().

Member Avatar for tetron
0
156
Member Avatar for aianne

You can't even install TC on MS-Windows version Vista or Win7. I tried it and it doesn't work. IMHO TurboC/C++ is a great compiler for hobbyists and teenagers or pre-teens. But in order to use it you must have an old version of MS-Windows or MS-DOS installed. Professional programmers wouldn't …

Member Avatar for Top9ne
0
1K
Member Avatar for edicar

post the file. Does one record consist of two or more lines in the file? If not, then why use %?

Member Avatar for Ancient Dragon
0
104
Member Avatar for micmagicfly

The loop starting on line 31 does more than what is necessary. Just use subscripts into the two strings [code] for( int count = 0; count < key.length(); count++) { if( answers[count] == key[count] ) grade++; else cout << "Answer # " << count+1 << " is wrong\n"; } [/code]

Member Avatar for Ancient Dragon
0
1K
Member Avatar for bushimports

>>Filenames is the container I am using. What container? Post how Filenames is declared. Is it std::string, vector<string>, or something else? We need a lot more details about it in order for anyone to tell you how to serialize it. Assuming Filenames is a vector<string>, then do it something like …

Member Avatar for Ancient Dragon
0
237
Member Avatar for MonteM

why? it's not necessary to null-terminate std::strings like it is with character arrays. As for the vector, its not necessary to null-terminate it either. If you want the number of strings in the vector then just call its size() method [icode]for(int i = 0; i < mylist.size(); i++)[/icode], or you …

Member Avatar for Ancient Dragon
0
85
Member Avatar for jephthah

What makes you think Tomm Gunn is a guy? I know for a fact that Narue is female. So if Tomm is a guy then of course he and Narue could not possibly be the same person, unless you know of a guy who can have babies.

Member Avatar for jephthah
3
682
Member Avatar for Violet_82

>>Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped That tells you that it did not generate an executable program. Did you save the source file after you created it?

Member Avatar for Violet_82
0
167
Member Avatar for smi ensi

You need to study your textbook or google for online tutorials about linked lists. They will show you how to write functions to insert and delete nodes in the linked lists.

Member Avatar for Ancient Dragon
0
136
Member Avatar for unbrknchane

You need to write GUI programs if you want to add sprites. The easiest way to do it is probably with OpenGL or DirectX libraries. >>Dev-C++ is what im running) Ditch it and install Code::Blocks with MinGW. Its a better IDE and supports current versions of g++ while Dev-C++ is …

Member Avatar for jephthah
0
240
Member Avatar for mosespascal

[URL="http://lmgtfy.com/?q=how+to+write+a+search+engine+in+c%2B%2B"]Start here.[/URL] But don't expect you will be productive for a few years.

Member Avatar for Fbody
-1
879
Member Avatar for rkp728

You can not declare objects in a header file without the [b]extern[/b] keyword. When you do it without that you will get the results you have because the objects will be defined in every *.cpp file in which the header file is included. Use [b]extern[/b] in header files. Then in …

Member Avatar for rkp728
0
3K
Member Avatar for vbx_wx

That's like saying "my car is broke. Anyone know how to fix it ?" Did you google for the error message? [URL="http://www.shirt-pocket.com/forums/archive/index.php/t-253.html"]Here [/URL]is one idea (running out of resources)

Member Avatar for vbx_wx
0
93
Member Avatar for Dani

I don't see any difference. But I did get 1,340,000 hits on [b]SERPS[/b] :sweat:

Member Avatar for cwarn23
0
229
Member Avatar for jephthah
Member Avatar for alcx88

Check the file system and see if the file actually exists. [quote]file has 0 characters, 0 words, and 0lines[/quote] Is that what you typed on the command line for the name of the file ????

Member Avatar for alcx88
0
250
Member Avatar for lionaneesh

To remove blank lines, just ignore them. Don't do anything with them. To remove trailing spaces: Set a pointer to the end of the character array, back up until the first non-white-space is found, then insert a string's null terminator at that point. For example, not that in the code …

Member Avatar for Ancient Dragon
-1
163
Member Avatar for sudiptamondal

Is there any professional software being developed in India with Turbo C compiler? I surely hope not, but I have no way of knowing.

Member Avatar for hkdani
0
459
Member Avatar for honeyboynasa

[QUOTE=ayan2587;1169457]i have reversed the string here by recursion..[/quote] And what do you suppose will happen to your program if the original string has more than two characters? Hint: bomb! If that is supposed to be a c++ why did you use a character array instead of std::string to hold the …

Member Avatar for ayan2587
-1
135
Member Avatar for VilePlecenta

>>Is there a way to fix this? Probably. My [b]guess[/b] is that the program is not using the right brush color for painting. There are lots of ways to do that but the simplest might be to make the brush a global object so that it doesn't get destroyed between …

Member Avatar for VilePlecenta
1
115
Member Avatar for lionaneesh

[quote]this programe is giving compile error:- SEGMENTATION FAULT [/quote] No it isn't. A Seg fault is NOT a compiler error, but runtime error. The compiler has finished doing its job by the time you run the program. line 18: c[i] = (' '); Remove the { and }. You don't …

Member Avatar for Luckychap
0
142
Member Avatar for skorm909

functions have to be declared before they can be used. Put [icode]int Mainmenu();[/icode] somewhere near the top of the program (such as between lines 5 and 6). That is called a function prototype.

Member Avatar for skorm909
0
90
Member Avatar for guest7

Delete line 19 because the prototype on that line is probably not the same as the prototype found in string.h. Why prototype something twice ?

Member Avatar for nezachem
0
466
Member Avatar for EngRania

I realize you put in a lot of time and effort writing/testing the program and you are probably hoping to make billions of dollars with it, but I think you might want to sell it as a shareware program and include the source code if someone actually registers the program …

Member Avatar for peter_budo
0
222
Member Avatar for Iqbal_h_a

Assuming you mean MS-Windows operating system, call [URL="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/globalmemorystatus.asp"]GlobalMemoryStatus[/URL].

Member Avatar for wsgeek
-1
454
Member Avatar for hvalola

Just a thought, but [URL="http://lmgtfy.com/?q=c+tutorial+for+joysticks"]this may help you[/URL]

Member Avatar for Ancient Dragon
0
52
Member Avatar for sean108

what compiler do you have ? You can get some old MS-DOS stuff [URL="http://www.codexxi.com/"]here[/URL]. They are not tutorials but actual working example programs.

Member Avatar for kendapcwiz
0
519
Member Avatar for cwarn23

[QUOTE=cscgal;1164239]Hi :) At this time, we're only accepting tutorials that are unique content to DaniWeb, and not reproduced elsewhere on the web.[/QUOTE] And the result is that there is only ONE tutorial in the c++ forum. Is the reason that no one has submitted any tutorials, or is it that …

Member Avatar for BestJewSinceJC
0
206
Member Avatar for Carrots

The base class is where you would put pure virtual functions so that all derived classes have to implement them. Although the boat class may not have doors, then getNoOfDoors() would just return 0 so that the virtual function would be implemented in the derived class.

Member Avatar for Ancient Dragon
0
118
Member Avatar for forceonez
Member Avatar for Ancient Dragon
-2
77
Member Avatar for g-company

[QUOTE=g-company;1168791]Hello i want to retrive information of various fonts used in an RTF file.so that i can use it in my RichEditCtrl class.[/QUOTE] That's nice. And I want a million dollars.

Member Avatar for Ancient Dragon
-2
38
Member Avatar for tarheelfan_08

The easiest way to create binary files is to use fixed-length character arrays instead of std::string. That will make each of the records in the binary fine the same size and you can easily locate any record in the file by simply multiplying the record number times record size. [code] …

Member Avatar for tarheelfan_08
0
3K
Member Avatar for MyrtleTurtle

No one knows everything about everything. IMO you will know you are a good programmer when your peers tell you that you are one. And that takes a lot of time and practice. Employers do not expect entry-level people to know a lot about programming. You should be able to …

Member Avatar for MyrtleTurtle
0
136
Member Avatar for Bhoot

you need to download and install the Windows Platform SDK because that compiler is too old. Get it [URL="http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en"]here[/URL]. After installing the PSDK in the VC++ 6.0 IDE select Tools->Options->Directories and add the include and lib paths.

Member Avatar for pdtx
0
340
Member Avatar for mikabark

where did you call popen() to open the pipe? [edit]Oh never mind. I checked the [URL="http://linux.die.net/man/2/pipe"]*nix man page [/URL]and it appears you did it the same way as in the example. Since I don't use *nix very often I have no clue what is wrong. [/edit]

Member Avatar for nezachem
0
143
Member Avatar for Freespider

That sounds like the classic circular array. The way I did it was to have two counters. The first counter indicates the maximum number of strings that can be put into the array (e.g. the array's allocated amount). The second counter indicates the next insertion position [icode]int nextpos;[/icode] When nextpos …

Member Avatar for abhimanipal
0
97
Member Avatar for nats01282

C, C++ and C# are all very similar languages, but also very different. Most of the concepts in C were used to create C++, and likewise most of the concepts of C++ were used to create C#. I agree with Myrtle that it may be better to lean one of …

Member Avatar for venkat arun
0
160
Member Avatar for mrnobody

Does one thread depends on the results of the other thread? Or main() needs the results of the other two threads() ? Maybe you need to add a WaitForMultipleObjects() -- or something like that -- in main(). Without more detail its hard telling what is going on. To answer your …

Member Avatar for Ancient Dragon
0
128

The End.