15,300 Posted Topics
Re: you probably didn't include <fstream> and add [icode]using std::ofstream;[/icode] | |
Re: 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. | |
Re: 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] | |
Re: read [URL="http://www.opengroup.org/onlinepubs/009695399/functions/pipe.html"]this thread [/URL]and its example program. | |
Re: 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); … | |
Re: >>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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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, … | |
Re: 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 … | |
Re: >>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. | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: It's very similar in c++ [code] #include <iostream> int main() { std::cout << "2.345 + 1.23 =" << 2.345+1.23 << '\n'; } [/code] | |
Re: >>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 … | |
Re: >>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 … | |
Re: 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 … | |
Re: google for that library and you will find several threads that discuss the problem. | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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] | |
Re: 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. | |
Re: I've seen that several years ago -- browse around Tools --> Options. [edit]^^^ Oh yes, there it is :) | |
Re: 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 … | |
Re: You most likely have to include <string> header file | |
Re: 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] | |
Re: Or to avoid costly addition operations [code] for (j = 0; pTemp[j] != '\0'; j++,i++) pWord[i] = pTemp[j]; pWord[i] = '\0'; [/code] | |
Re: 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 … | |
Re: 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 … | |
Re: 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; … | |
Re: 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] | |
Re: 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. | |
Re: Didn't your local WalMart sell it on the day of release? Mine did, but I don't know about UK stores. | |
![]() | Re: >> 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. |
Re: [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 … | |
Re: @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 … | |
Re: the [b]const[/b] keyword following a function declaration means the function will not change anything. | |
Re: >>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 … | |
Re: [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. | |
Re: 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. | |
![]() | Re: 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. |
Re: >>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] |
The End.