15,300 Posted Topics

Member Avatar for n0de

you probably didn't include <fstream> and add [icode]using std::ofstream;[/icode]

Member Avatar for n0de
0
375
Member Avatar for bookmark

The project you are compiling contains at least two main() functions, one in test.cpp and the other in test2.cpp. You need to delete one of the two main() functions, or one of the two *.cpp files.

Member Avatar for Ancient Dragon
0
133
Member Avatar for e!sa

replace the 6 with a star then put the variable in the parameter list [code] sprintf(blah, "%c%-.*s%c", QUOT, 6, varName, QUOT) [/code]

Member Avatar for Sumanth13
-1
87
Member Avatar for sciprog1

read [URL="http://www.opengroup.org/onlinepubs/009695399/functions/pipe.html"]this thread [/URL]and its example program.

Member Avatar for sciprog1
0
176
Member Avatar for sweety20
Member Avatar for TonyMUK

lines 18-31 -- why do all that memory allocations?? Just declare the variables normally and pass them to other functions by address, something like this. [code] static unsigned char buffer1[101]; /**********************************************************************/ int main() { static cwbDQ_QueueHandle queueHandle; static cwbDQ_Data queueData; int result = 0; static cwbCO_SysHandle sysHandle; result = cwbCO_CreateSystem(TEXT("172.22.1.200"),&sysHandle); …

Member Avatar for TonyMUK
0
137
Member Avatar for Dean_Grobler

>>I want to download it from work. But obviously there's a firewall stoping me from going into 99% of such sites You don't like your job very well do you??? Attempting to get past the firewall will most likely get you fired. Download that music from home where you can …

Member Avatar for Dean_Grobler
0
175
Member Avatar for baldwindc

infp is a pointer to a FILE structure, which is returned by fopen(). The statement is actaually written incorrectly. More accurately it should be [icode]while( fgets(buf,MAXLINE,infp) != NULL) fputs(buf,outfp); [/icode] There is not need for feof() because fgets() returns NULL when end-of-file is reached.

Member Avatar for Ancient Dragon
0
146
Member Avatar for rommelgenlight

MS Access is not a good choice for large databases. Move on to something else, such as MySQL, Sybase, or Microsoft SQL Server. I don't know what the max size is of their databases but I know they are better than Access. So I would not ask M$ to increase …

Member Avatar for Ancient Dragon
0
362
Member Avatar for Hyiero

Maybe the easiest way to do that is to make a completly new linked list. Transverse the original linked list and select the nodes that have 25% discount then add them to the new linked list. After that add all the other nodes.

Member Avatar for Hyiero
0
735
Member Avatar for Fbody

There is no such thing as a pure OOP c++ program. There are only two kinds of programs: event driven and procedural. MS-Windows GUI is event driven where someone clicks a button and the program responds to it. Console programs are procedural where they just run from start to finish, …

Member Avatar for Fbody
0
161
Member Avatar for Kieran Y5

Yes, you can create the program, but VC++ can not compile for platforms other than MS-Windows and a few embedded devices. IMO if you need the program to be compatible on both MS_Windows and *nix then use Code::Blocks with MinGW on MS-Windows and Code::Blocks with g++ on *nix. If you …

Member Avatar for Kieran Y5
0
189
Member Avatar for knellgust

>>book[i]=new Book(T,P); The error is telling you that the Book class does not have a constructor that takr two arguments. You need to add another constructor that takes two strings.

Member Avatar for alaa sam
0
182
Member Avatar for Fredszky

First, don't use [b]scanf()[/b] because it won't take anything beyond the first space you type, consequently you can not enter a file name that includes spaces. You need to use fgets() for that. Next, you have to concantinate the two strings together. [code] char filename[260]; // max allows in MS-Windows …

Member Avatar for vinitmittal2008
0
186
Member Avatar for Agapelove68

Death of PC? Well, probably in 100 or so years from now after something better has been invented and accepted in business to replace the PC.

Member Avatar for Agapelove68
0
244
Member Avatar for christina>you

from purely [b]efficient[/b] point of view, dictatorship is obviously more efficient because only one person (ok maybe a small group of people) make all the decisions, eliminating all the problems and delays associated with allowing the citizens to cast ballots. And that is one of the reasons why we in …

Member Avatar for Future_Dictator
0
1K
Member Avatar for shotbylammi

It's very similar in c++ [code] #include <iostream> int main() { std::cout << "2.345 + 1.23 =" << 2.345+1.23 << '\n'; } [/code]

Member Avatar for Fbody
0
171
Member Avatar for quangvn

>>Function read will periodic read dat from file to buffer By periodic, do you mean once an minute, hour, day, week, month, or what? I think you might want to have your program create two threads -- one thread for reading and the other thread for writing. Then the program …

Member Avatar for Shankye
0
168
Member Avatar for protas

>>void main () main() always returns an integer -- its never void even if your compiler allows it. Many compilers won't let you declare void main(). Get into the habbit of writing programs correctly and always declare it as [icode]int main()[/icode] or [icode]int main(int argc, char* argv[])[/icode] I could offer …

Member Avatar for protas
0
137
Member Avatar for writt

first create a structure to hold all the information from one student. Next you will have to know how to open a file and read it, most likely one line at a time. If you don't know how to open a file and read it then you need to study …

Member Avatar for Ancient Dragon
0
111
Member Avatar for mca.narender

google for that library and you will find several threads that discuss the problem.

Member Avatar for Ancient Dragon
0
106
Member Avatar for jeremy62

There are lots of problems in function main(). Since I am responding to your post after 6 hours from when you posted it I hope you did not sit idle all this time watching TV, playing games, or anything else. I could go on and on about all the problems …

Member Avatar for Ancient Dragon
0
218
Member Avatar for ajay prajapti

So, you upgraded from Office 2003 to Office 2007, and not Outlook 2007 doesn't work? Before resorting to restoring the entire system try re-installing Office 2007 and let it fix any errors that it might find. Make sure you are logged in an Administrator account when you do that. What …

Member Avatar for Ancient Dragon
0
167
Member Avatar for mca.narender

you posted the header file for bzlib.h but where is the source file? That header file is useless if you don't have the source file(s) or library that implement all those functions.

Member Avatar for Ancient Dragon
0
185
Member Avatar for Syrne

The loop on line 55 is not saving the data in memory. It is just simply overwiring all the data that was read during the previous iteration of that loop with new data. If you want to do anything useful with any of that data you need to save it …

Member Avatar for Syrne
0
157
Member Avatar for Ninjah

You don't understand the use of the double \\ in strings. The \ chacter in C/C++ is used as an escape sequence and tells the compiler to treat the following character differently from other characters. For example '\n' is a newline, '\t' is a tab (there are several others), and …

Member Avatar for Fbody
0
5K
Member Avatar for Martje
Member Avatar for sciprog1

You have the wrong idea about that parameter. It's supposed to be a pointer to an integer that you declare in your program. [URL="http://linux.die.net/man/2/wait"]Read the man page for more information[/URL] [icode]pid = wait(&status)[/icode]

Member Avatar for sciprog1
0
251
Member Avatar for Madawar

Check [URL="http://www.daniweb.com/code/snippet216812.html"]this thread [/URL]out -- it was written in c++ but could be easily ported to C. If you read the code you will discover that it uses recursion to crawl though all sub directories.

Member Avatar for Madawar
0
417
Member Avatar for chamnab

I've seen that several years ago -- browse around Tools --> Options. [edit]^^^ Oh yes, there it is :)

Member Avatar for Ancient Dragon
0
97
Member Avatar for lauruskamj

Step 1: read the two numbers on the first line. Name the variables x and y. Then allocate a 2d array of that size [code] int x,y; // read x and y from file not shown here int **matrix = 0; // this is the matrix you need to allocate …

Member Avatar for Ancient Dragon
0
98
Member Avatar for hero0765
Member Avatar for jnewing

line 46 does not require use of new because bar is not a pointer. This is all that line 46 needs to do. [icode]bar b(fc);[/icode]

Member Avatar for Ancient Dragon
0
170
Member Avatar for arineon

Or to avoid costly addition operations [code] for (j = 0; pTemp[j] != '\0'; j++,i++) pWord[i] = pTemp[j]; pWord[i] = '\0'; [/code]

Member Avatar for darkbreaker
0
150
Member Avatar for tech9x

lines 12, 13 and 14 are in the wrong order. Move line 12 down below line 14, when the value of sizeOfArray is known. You have to do things in logical sequence -- first get the value of sizeOfArray from the keyboard and then allocate the character array of that …

Member Avatar for mike_2000_17
0
138
Member Avatar for whodoes21

Those are not pointers. Here is how you make an array of pointers to strings. With this, your program has only one variable name to contend with, not 12. [icode]char *no[]={"1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","11th","12th"};[/icode] Once you enter a value 1-12 you can easily display the string using that index value, but first you …

Member Avatar for whodoes21
0
197
Member Avatar for daviddoria

Just convert the int to a string and add "0x" to the beginning of the string [code] int serial = 40000359; char result[20]; sprintf(result,"0x%d", serial); [/code] Or if you want to use only c++ [code] #include <sstream> #include <string> #include <iostream> int main() { int serial = 40000359; std::string result; …

Member Avatar for daviddoria
0
177
Member Avatar for moroccanplaya

opendir() is used to begin reading the names of the files and folders stored in a directory. There is lots of information and examples around the net how to use it -- just use google. [URL="http://www.dreamincode.net/forums/topic/59943-accessing-directories-in-cc-part-i/"]Here is one very good tutorial[/URL]

Member Avatar for moroccanplaya
0
132
Member Avatar for Martje

You will probably have to rewrite all the text lines. Read the lines of the text box into an array of Strings, format the Strings the way you want them, then write the Strings back to the text box.

Member Avatar for Ancient Dragon
0
103
Member Avatar for Dannyo329

Didn't your local WalMart sell it on the day of release? Mine did, but I don't know about UK stores.

Member Avatar for Kamatari
0
133
Member Avatar for dvspinay

>> unresolved external symbol "int __cdecl inputData(class std::basic_string<char That means you declared and called a function named inputData() but never coded the body of that function.

Member Avatar for Ancient Dragon
0
167
Member Avatar for geryin

[quote]In mathematics, a rational number is any number that can be expressed as the quotient a/b of two integers, with the denominator b not equal to zero. Since b may be equal to 1, every integer is a rational number. The set of all rational numbers is usually denoted by …

Member Avatar for Ancient Dragon
0
146
Member Avatar for tech9x

@tech9: Read the error message very carefuly -- it is telling you everything you need to know in order to fix the problem. You passed a std::string object, but the function requires char*. Now how do you correct that? Ask yourself how to convert std::string to char*. If you don't …

Member Avatar for Zjarek
0
280
Member Avatar for svatstika

the [b]const[/b] keyword following a function declaration means the function will not change anything.

Member Avatar for Ancient Dragon
0
264
Member Avatar for stark025

>>I don't think conio.h is depraceted As for C and C++ standards go -- no it isn't because it was never part of the standards in the first place. It's compiler specific. I suppose a specific compiler can declare something depreciated if it wants to (Microsoft has declared most of …

Member Avatar for stark025
0
261
Member Avatar for oksbwn

[QUOTE]hello friends actually i want to know which compiler is best suitable for gui development using c.please send the web adress to download that and send how to configure that.[/QUOTE] It will depend on the operating system. As previously mentioned QT is good for cross patform.

Member Avatar for Ancient Dragon
0
162
Member Avatar for gyst

use your compiler's debugger to step through the program and find out whay it crashes. I could make a couple guesses, but that's all it would be -- guesses.

Member Avatar for Ancient Dragon
0
117
Member Avatar for tawes01

Customizing the edit control can get pretty complicated. [URL="http://stackoverflow.com/questions/1955538/win32-how-to-custom-draw-an-edit-control"]Here[/URL]'s one thread on that topic. [URL="http://lmgtfy.com/?q=subclass+edit+control"]Here[/URL] are a few others.

Member Avatar for Ancient Dragon
0
146
Member Avatar for frogboy77
Member Avatar for TheBaby7591

>>for (k = 0 ; k <= c ; k++) Should be < c, not <= c. >>I'm just unsure how to return the values from the structure with designating a matrix like this The same as you would any other matrix [icode]return m->elements[r][c];[/icode]

Member Avatar for vinitmittal2008
0
182

The End.