15,300 Posted Topics

Member Avatar for swathydoss

[QUOTE=swathydoss;1117778]hi....... i want a program in c based on any data structures with de code.plz............it shd be catchy n can be based on reality[/QUOTE] And you should learn how to write proper English instead of that baby googoo gaagaa talk. That's what's wrong with kids these days -- cell phones …

Member Avatar for jephthah
-4
90
Member Avatar for WolfPack

This is your lucky day -- I gave you positive instead of negative rep for bumping a 4-year-old thread If you only read one byte into a 4-byte integer that would make the integer not worth shit. You can't do it like that (at least so that it will produce …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for Evan M

vc++ 2008 Express produces a runtime error on that [icode]delete ptr;[/icode] line because the class instance was already deleted. I've seen a few class objects delete themselves -- such as Microsoft's COM functions.

Member Avatar for Evan M
0
114
Member Avatar for SecurExpert

There is no difference because C compiler normally ignore spaces. You can code it either way unless your instructor (assuming you are a student) or other coding standards say otherwised.

Member Avatar for Ancient Dragon
0
66
Member Avatar for tanu4m
Re: help

Most of us can probably do that, but we are not in your classroom. Post whatever you have done to solve that problem and ask questions. The first things you need to do is [b]listen[/b] in class (assuming you attended class at all), then [b]study[/b] your textbook.

Member Avatar for Ancient Dragon
-1
89
Member Avatar for downtimedk

See the win32 api function GetOpenFileName() [URL="http://www.codeguru.com/forum/showthread.php?t=392963"]here[/URL] and [URL="http://msdn.microsoft.com/en-us/library/ms646927%28VS.85%29.aspx"]here[/URL].

Member Avatar for Ancient Dragon
0
306
Member Avatar for nick30266

what version of Windows are you running? Unregister that ActiveX control and try to open the file again. If it works then there is probably something wrong with that ActiveX control.

Member Avatar for Ancient Dragon
0
64
Member Avatar for DavidB

>>in your case a query like site:[url]www.daniweb.com[/url] "free online television" Hum ... never new we could do that :)

Member Avatar for ~s.o.s~
0
143
Member Avatar for johny321

If you have a 64-bit computer than you will want to download the 64-bit version of *nix. But be warned that 64-bit is not well supported, that is you might have problems getting some 64-bit device drivers and programs. I never had problems with the os itself, just device drivers …

Member Avatar for ybkumar77
-2
105
Member Avatar for gianx80

Just like C and C++ you have to prototype the functions that you want to call. That function "rad" does not appear anywhere in that file except the call statement.

Member Avatar for Salem
0
247
Member Avatar for scholar

You can't call any MS-Windows programs (such as Notepad.exe) from a 16-bit compiler because the compiler doesn't know how to do that.

Member Avatar for WaltP
0
248
Member Avatar for jennystc

I suppose one way to do it would be to create an array of 101 characters, each array element represents the numeric grade. The use the grade to index into that array. For example [code] char grades[101] = {0}; grades[100] = grades[99] = grades[98] = grades[97] = grades[96] = grades[95] …

Member Avatar for abhimanipal
0
190
Member Avatar for jamshid

I'm sure you all worked very hard to write those little programs but I think they are quite useless to anyone without lots of comments that explain what the programs are doing. No one is going to wade through all that uncommented code and try to figure it out for …

Member Avatar for csharpisatechno
0
25K
Member Avatar for supernater

Most programs will use the Microsoft Treeview Control. [URL="http://www.codeguru.com/cpp/controls/treeview/classes/article.php/c13167/"]Here is some sample code[/URL]. The treeview control generates an OnClick event and one of its parameters is the node that was clicked.

Member Avatar for supernater
0
90
Member Avatar for chuong3a

CFree uses MinGW compiler, which is a 32-bit compiler. Therefore you can not use graphics.h or its library with that compiler. As for OpenGL, just install it on your computer then set up CFree to use it. I have never used CFree, but from its home page and description it …

Member Avatar for gridandy
0
189
Member Avatar for smarty_t2

>>Is there a way through which i can clear all the inputs at the end of loop.. [code] while( kbhit() ) getche(); [/code]

Member Avatar for VilePlecenta
0
762
Member Avatar for lima01

If you want a list of all the files on your he you don't need the \ character at all. Just this: [icode]system("dir c: /s > c.txt");[/icode]

Member Avatar for lima01
0
167
Member Avatar for gowth08

You are assuming everyone knows that SHOP, BFS, and TLE mean. We don't. You might get more help if you would provide links to that. Also, that appears to be a C program, not C++.

Member Avatar for Ancient Dragon
0
167
Member Avatar for Kennych

Use the modular operator, which will return a value between 0 and maxNumber. [icode]int x = rand() % maxNumber;[/icode]

Member Avatar for Ancient Dragon
0
59
Member Avatar for SpyrosMet

Depends on the operating system. But [URL="http://winprog.org/tutorial/"]here is a tutorial [/URL]for MS-Windows. There are easier ways to create GUI windows. One of them is C#, while another is using c++/CLR and VB.NET. c++ is not a good language for that purpose although it can be done quite successfully (and a …

Member Avatar for Ancient Dragon
0
100
Member Avatar for lsandling

If this is part of a c++ class then make those two variables members of the class. If not, then you can declare them in main() and pass them around to the functions that use them. In the case of the function you posted, you will have to pass them …

Member Avatar for lsandling
0
118
Member Avatar for fenerista

If all you want to share is a header file and *.cpp file then I wouldn't bother making a DLL because that is like killing a fly with a sludgehammer. Instead, just create a static library project and add those two files to it. Then in each of the application …

Member Avatar for fenerista
0
264
Member Avatar for yila

The problem is that you did not clear out the destination buffer when you declared it [code] char str[20] = {0}; char enc[20] = {0}; [/code]

Member Avatar for yila
0
99
Member Avatar for Szabi Zsoldos

You can use c++ [URL="http://www.cplusplus.com/reference/algorithm/random_shuffle/"]ramdom_shuffle[/URL]() to scrample the names. I have not used it myself so can't tell you how to do it. The rest of that program should be pretty straight forward.

Member Avatar for jonsca
1
375
Member Avatar for Dragonsreign

Delete it and install a better compiler such as Code::Blocks or VC++ 2008 Express. I know they both work ok.

Member Avatar for Dragonsreign
0
927
Member Avatar for psdao1102

assert() only shows something when the program is compiled for debug. If compiled for release assert() does nothing. In your example it is better to test for [icode]inFile.is_open()[/icode], which works in both debug and release mode compiles. [code] int main() { ifstream inFile; ofstream outFile; inFile.open("file.txt"); if( !inFile.is_open() ) { …

Member Avatar for Ancient Dragon
0
118
Member Avatar for chuong3a

What are the problems with that program? You don't take your car to an auto shop and tell them "My car is broke, please fix it" :) You have to at least tell them what the problem is.

Member Avatar for chuong3a
-1
98
Member Avatar for SpyrosMet

I think you might be talking about an array of pointers to some objects, and the pointers are NULL if it does not contain valid pointer. Something like this: [code] class MyClass { // blabla }; // an array of 10 pointers to MyClass objects, // initialized to NULL pointers. …

Member Avatar for kvprajapati
0
122
Member Avatar for atticusr5

>>undefined reference to `cAccount::cAccount()' That means you defined a constructor in the class but never coded the implementation function.

Member Avatar for Ancient Dragon
0
112
Member Avatar for sadhramani

[QUOTE=sadhramani;1117815]char *mon; mon is a character pointer variable. Is there any problem with the declaration?[/QUOTE] strncpy() does not allocate memory for the destination address, that has to be done by the calling function. So you might want to declare it like this: [icode]char mon[255] = {0};[/icode]. That allocated enough memory …

Member Avatar for Narue
0
155
Member Avatar for SpyrosMet

>>Plants plant1(); When declaring an object do not include the (). Its just [icode]Plants plant1;[/icode]

Member Avatar for SpyrosMet
0
359
Member Avatar for abhimanipal

I've toyed around with that some time ago too, trying to see what happens when main is declared to return char*. My compiler just returned the address of the string, which is an integer. Similar with [icode]void main()[/icode]. In this case the compiler produced code to return whatever value was …

Member Avatar for Narue
0
243
Member Avatar for Chetan_

Its very possible that on line 25 the value of size will be 0. new can handle that ok but will return a pointer to a zero length string and line 25 will trash memory when that happens. >>//inserts b inside a from index m to n I don't think …

Member Avatar for mitrmkar
0
200
Member Avatar for markfisher

I agree its stupid thing to do, unless of course the wrapper function does other things too.

Member Avatar for WaltP
0
77
Member Avatar for Stefano Mtangoo

The only thing about VC++ 2008 that I do not like (same with version 6.0) is those blasted docking windows. Every once in awhile I accidently undock a window and have a real hard time putting it back into position.

Member Avatar for VilePlecenta
0
232
Member Avatar for justinclev

If you are using VC++ 2008 or Code::Blocks those IDEs will generate some of the DLL code for you. Then all you have to do is add the functions you want, declare then with __dllexport (or add the function name to a *.def file). You can even export entire c++ …

Member Avatar for Frederick2
1
128
Member Avatar for bharathilakshmi
Re: C

Yes of course its possible. How to do it will depend on the file's format. Not all images are equal. [URL="http://lmgtfy.com/?q=image+file+format"]Here are some links [/URL]for you to research.

Member Avatar for Ancient Dragon
-2
49
Member Avatar for stacey3122

You will want to use a two-dimensional array for that -- the first dimension is the distance and the second dimension indicates whether there is a car in that spot or not. So you will want to declare the array something like this: [code] const int MaxParkingSpaces = 10; int …

Member Avatar for Ancient Dragon
0
58
Member Avatar for Ancient Dragon

I have Win7 and using FF with Logitech wireless keyboard and mouse. The problem is that the mouse wheel stopped working (it won't scroll the window any more, or just scrolls intermittently for very short periods of time) but everything else works as expected. Changed the battery but that did …

Member Avatar for SillyBilly
0
153
Member Avatar for green_leav

1) it will depend on how you created the array. If you use <vector> then you don't have to do anything special because it will auto expand as you add data. But if you use something like [icode]int* array = new int[25];[/icode] then you have to first allocate a new …

Member Avatar for green_leav
0
154
Member Avatar for tinek

See functions in time.h -- particularly mktime() and structure time_t. Also it's not called "forcasting time" -- that is not forcasting anything. Its just simply advancing to some future date.

Member Avatar for Dave Sinkula
0
100
Member Avatar for ameerkw
Member Avatar for wilsonz91

You might have to make a few minor changes to your program, depending on how you coded it. For example [code] for(int i = 0; i < something; i++) cout << "Hello\n"; if( i > 10) // blabla [/code] VC++ 6.0 will allow the above code but c++ standards and …

Member Avatar for Ancient Dragon
0
168
Member Avatar for blue3hree

name_t on line 16 overrides the name_t typedef on line 10. Bad idea. line 15 could be declared as simply [icode]char space = ' ';[/icode]. No need for the array syntax. I fail to see why you need first_name to be a two dimensional array of 255 characters each dimension! …

Member Avatar for Ancient Dragon
0
192
Member Avatar for swolll

Get either Code::Blocks with MinGW compiler or VC++ 2008 Express, both are free. Which to use might depend on what compiler your university has.

Member Avatar for Salem
0
313
Member Avatar for SnipeTechie
Member Avatar for NathanOliver

Sorry but that is not a quine program (see [URL="http://en.wikipedia.org/wiki/Quine_%28computing%29"]this link[/URL]). [quote]A quine takes no input. Allowing input would permit the source code to be fed to the program via the keyboard, opening the source file of the program, and similar mechanisms.[/quote]

Member Avatar for NathanOliver
0
152
Member Avatar for bobbuilder67

Turn off UNICODE -- goto Project --> Properties (the last menu item) -->Configuration Properties --> General. Now on the right side, the third item from the bottom is "Character Set". Change that setting to "Not Set" You could have turned off precompiled headers in a similar way, except under Configuration …

Member Avatar for bobbuilder67
0
440
Member Avatar for juggalo
Member Avatar for D_switch

I got it to compile with VC++ 2008 Express with only a couple minor changes. A couple obversations: 1) line 45: [b]code[/b] should be declared as int, not char because the scanf() on line 58 expects a pointer to an int. 2) delete all lines that call fflush(stdin) because fflush() …

Member Avatar for WaltP
0
4K

The End.