15,300 Posted Topics
Re: [sarcasm]Ha Ha[/sarcasm] -- moved to Geek's Lounge because your post was not an introduction. | |
Re: You need VC++ 2005 or 2008 Pro or better edition because that project uses MFC. Express edition can not compile it. If you have the compiler then just double-click PBXClient.vcproj | |
Re: never heard of such a thing, most likely because it would be grossly inefficient. The library at [url]www.DataReel.com[/url] contains client/server code ported to both *nix and MS-Windows, but it uses standard sockets. | |
Re: [code] int main(int argc, char*argv[]) { ofstream out; if( argc == 2) { out.open(argv[1]); if( !out.is_open()) { cout << "Failed to open the file \"" << argv[1] << "\"\n"; return 1; } { else { cout << "usage: myprog filename\n"; return 1`; } // now write to the file ... … | |
Re: I've used a debugger to step through some of the printf() code on MS-Windows and found that eventually it calls win32 api WriteFile(). From that experience I would imagine other functions also eventually call win32 api functions. But those are the details that are compiler-implementation specific. There is nothing in … | |
Re: line 49 of the *.cpp file -- that should probably be /= operator. When I run your program I get this error [quote] Assertion failed: stackTop != 0, file c:\dvlp\try1\try1\stackarray.h, line 109 Press any key to continue . . . [/quote] | |
Re: >>2.sizeof is compile time operator. what does that mean ? It means that its only evaluated when the program is compiled because the result is a const unsigned int. >>3.what about all other opearators arent they compile time? Sometime yes and sometimes no. The = operator has to be evaluated … | |
Re: You can turn off precompiled headers by selecting menu item Project --> Settings, select the c++ tab, in "Category" select "Precompiled Headers" then select the "Not using precompiled headers" radio button. | |
Re: I began learning MFC from Microsoft's [URL="http://msdn.microsoft.com/en-us/library/aa716527%28VS.60%29.aspx"]Scribble Tutorial[/URL] | |
Re: 1) Either Code::Blocks or VC++ 2008 Express, both are free 2) MS-Windows. *nix has little support for serious games 3) Tons of sites. Can't recommend any because I don't write games. 4) No. It should be in the IT Professional's Lounge. | |
Re: >>can anyone answer this question? Yes I can do it, but won't. | |
Re: [QUOTE=rechene;1022958]need a quick answer[/QUOTE] Then you should have googled for the answer. That question has been asked and answered millions of times. | |
Re: If you don't free() the memory before leaving that function then yes, there will be memory leak. In c++ program you should use new and delete[] instead of malloc() and free(). | |
Re: >>Is the data structure I used (linked - list ) wrong and not be compatible inside class ? No -- you should be able to use a linked list within a class >> Is there another data structure better than linked-list ? Yes -- use either <vector> (which is an … | |
Re: If you used g++ on linux then you should probably use Code::Blocks with MinGW compiler on Windows. | |
Re: In sprite.h the vertices and colours arrays can not be initialized in the class like that. It doesn't work the same as global variables. You have to put the initialization code in the class constructor. | |
Re: [icode] short* pnum = static_cast<short*>(&const_cast<short&>(someFunction()));[/icode] or this [icode] const short* pnum = static_cast<const short*>(&someFunction());[/icode] | |
Re: what do you mean by "it is not running" ? Why don't you get rid of that charcater array and read the line directly into the string. [code] string data; while( getline(in, data) ) { // blabla } [/code] | |
Re: column names of the table should not be enclosed in quotes. | |
Re: Probably yes, see the functions in graph.h. As for ebooks, you might get some of [URL="http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&source=hp&q=turbo+c+ebooks&btnG=Google+Search"]these for Turbo C[/URL] | |
Re: simple -- print spaces instead of '#' characers. We aren't going to actually give you the code, so try it and post your code if you have more problems/questions. | |
Re: >>the program adds the last number "5" twice That's because you are wrote the loop incorrectly. Do it like this: [code] while ( InputStream >> n ) { // blabla } [/code] | |
Re: lines 33 and 34: >>char *c; >>c = &line[0]; That is not necessary. Just pass line.c_str() to the function on line 39 line 71: all you have to do is use isdigit() function [icode]if( isdigit(*c)) [/icode] line 82: get rid of all that crap and use isalpha() [icode]if( isalpha(*c) )[/icode] … | |
Re: you have to keep track of 10 ranges. Every time you generate a new random number check to see which of the 10 ranges it falls in and then increment that counter. Once you get that done and working right it should be not too difficult to print out the … | |
Re: Which operator do you need to overload? Such as, do you need to write and read the classes to file? IN that case you could overload the << and >> operators. | |
Re: In the two arguments to main(), argc is the number of arguments (command line arguments are separated by spaces or tabs), and argv is an array of the strings. So if you type this [icode]myprog --lines-per-page 30[/icode] argc will be 3 and argv will be argv[0] = program name argvp[1] … | |
Re: The loop starting on line 73 is wrong. eof() doesn't work the way you think. And you don't need that third parameter '\n' to getline() because that is the default. [code] while( getline(nameFile,input) ) { // blabla } nameFile.clear(); // clear error nameFile.seekg(0, ios::beg); // back to beginning of file … | |
Re: Your first program worked correctly for me using vc++ 2008 express. | |
Re: With 112 posts I know you know how to use code tags. Then edit your code to correct all the typing mistakes you made when posting those classes. | |
Re: >>ifstream *MyFile; Remove the * -- c++ streams are not normally pointers. >>programname = argv[0]; argv is not a variable declared in t CreateAllNodes() function I think you put that function declaration in the wrong place. | |
Re: >>I must use Fork() and Wait() Why? Sounds like over complication of the problem. >>myComd is an unallocated pointer which can not be used until you allocate memory to it. IMHO don't make it a pointer; remove the star and replace pointer notation "->" with dot notation "." >> line … | |
Re: It was true a few years ago that VC++ 6.0 was not very standards-compliant compiler. I suspect they got so many complaints about it that M$ decided to make it fully c++ compliant. The problem with Microsoft compilers is that they do not support POSIX standards. So a lot of … | |
Re: Here you go, now all you have to do is fill in the missing parts [code] #include <string> class Student { // your code goes here }; int main(int argc, char* argv[]) { // your code goes here } [/code] | |
Re: Is customer_id a string or an integer? [code] int customer_id = 11; char filename[255]; sprintf(filename,"%04d.txt", customer_id); ofstream file (filename); [/code] There are other ways to format the string, but IMHO the above is the simplest. | |
Re: >>void matrix_input(int mat[][dim], char* name) What is variable [b]name[/b]? It doesn't make much sense in the context of that function. | |
Re: You can't just simply ignore it. You have to read it and then don't use it for anything. | |
Re: Forget about 2005 Express -- its been updated to 2008 Express. 2008 is a better compiler anyway and doesn't need the Windows SDK in order to produce windows gui programs. But you have to hurry because it won't be available for much longer, as soon as 2010 is released (its … | |
Re: you will have to get it as a string, not a double, so that your program can check for extraneous characters, such as "...". If it passes that test then convert to double and check for negative value. | |
Re: Unfortunately AFAIK push_back is the only way to initialize it. The vector is a single object, not an array of objects, so an initialization list is not possible. | |
Re: [code] 1>c:\documents and settings\myfolder\desktop\mydocs\c\visual\memory\memory.cpp(57) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [/code] That is a Microsoft-Specific warning message. M$ doesn't like using the standard C style string functions like strlen(), strcpy() etc … | |
Re: What compiler? Operating system? GUI API ? If you are working with MFC then progress bar isn't all that difficult. | |
Re: move line 11 down outside that loop because it is causing the loop to execute only once. Is there more to that function then what you posted? Because it is pretty much a worthless function the way it is posted. Why declare an array of 255 Customer classes when you … | |
Re: Your program is pretty close, you just need a few changes, such as [icode]int main()[/icode], use pointer to array in scanf() and flush out the '\n' characters [code] int main() { int array[50],i,ele,n; char a; //clrscr(); printf("the list should be sorted in ascending order\n"); printf("enter the size of array\n"); scanf("%d%c",&n,&a); … | |
Re: Take it in small steps. First write a program that just lets you enter the year. Get that working then add more that lets you enter the month and day of month. If you enter the month as a number you can then create a switch statement that calculates the … | |
Re: Homework Hummmm. We don't do your homework for you. | |
| |
Re: [QUOTE=The Mad Hatter;1006497]I'm curious. You seem so sure, but you don't say why, and your assurance is totally at variance with my own experience. In fact I'll state straight out that Linux is easier to use than Windows.[/QUOTE] I tried two different distributions of *nix (Fedora 11 and Ubuntu) over … | |
Re: It compiles ok with VC++2008 Express too. I don't have g++ 4.4 so I can't test it. | |
Re: C language doesn't have a real character data type. [b]char[/b] is just a one-byte integer, and all characters such as '=' are treated exactly like integers. You can safely assign '=' to either a char or int data type (also long, long long, __int64, float or double). You can also … | |
Re: Which those constraints all bets are off. You wrote the OS so you will have to write all the low-level stuff. Does it even support C language? A compiler? How do you run any programs in that os? |
The End.