15,300 Posted Topics
Re: Did you post the EXACT question and code because that code will not compile due to several syntax errors. >>What will be printed if the user enters “Wingding”? Nothing because there is nothing in the program to accept anything from the keyboard. | |
Re: The can of Dr Pepper I am now drinking doesn't emit any vibrations on its own, so that theory is proved false. | |
Re: you can't do that. But what you can do is have a vector of vectors, just like a 2d array of doubles [code] vector<double> columns; vector<columns> rows; [/code] Now each row is like your vector_0, vector_1, etc. | |
Re: I have no idea what you are talking about. What is "lazy evaluation" ? And why does it matter whether cio_putstr() returns void or something else ? | |
Re: >>it sorts but then just quits out of the program for no reason.. Nope. It quits because there are problems with the code you wrote. Please post the code so that we can help you. The basic idea of sorting structures is the same as sorting an array of integers. … | |
Re: you have a few problems with that class. I just put all the files into one *.cpp file because I was too lazy to use separate files as you posted them. The main problem was in the readBinary() function. Using the sample data you posted I got the same output … | |
Re: Welcome to DaniWeb. With all your experience I suspect you will be a big asset for helping others. | |
Re: >>Is it possible to print anything on screen in C or C++ without using main(). Yes -- write a MS-Windows win32 api program which uses WinMain() instead of main(). Or use VC++ 2008 and it will generate a console program that starts with _tmain(). | |
Re: I think your loop is wrong [code] int main() { char op; do{ printf("\n"); printf(" A : Quadrado\n "); printf("B : Rectangulo \n"); printf(" C : Circulo\n"); printf(" D : Triangulo\n"); printf(" E : Trapezio\n"); printf(" Indique a opcao : "); scanf("%c",&op); op = toupper(op); // cin.ignore(256); // printf(" Opcao … | |
Re: read them in as characters so that you can read them one character at a time. | |
Re: Is there a question there? Or are you just posting your code because you are very proud of it? | |
Re: >>What types of job positions are computer programmers needed for, Other than the obvious software development types? I've had programming jobs at banks, accounting, manufacturing plants, government, and military. The most interesting ones to me were at the manufacturing plants, such as donuts, paper mills, tooth brushes, and jellybeans, just … | |
Re: Welcome to DaniWeb. Please feel free to browse around the many threads we have about networking and other topics. | |
Re: Steps [list] [*]Open original file for input, in binary mode std::binary as second parameter [*]Open output file for writing in binary mode [*] Create an unsigned char array for i/o [*]In loop call ifstream's read() method to read , then write the buffer using ofstream's write() method, until end-of-file. [*]Close … | |
Too bad they don't [URL="http://www.youtube.com/watch?v=lF4qii8S3gw&NR=1"]teach this [/URL]in school any more :) | |
Re: try pre-declaring the classes in the header files, but that works only if the object you want to use is a pointer. So you would probably have to change [icode]GLCursor MovementCursors [/icode]to a pointer [icode]GLCursor* MovementCursors;[/icode] [edit]what ^^^ said :) [/edit] | |
Re: srand() doesn't return a value. All that function does is seed the random number generator. What you want is rand(), not srand(). srand() should be called only once at the beginning of the program to seed the generator. From then on the program calls rand() to get a random number. … | |
Re: >>only prob i have now is storing it in2 an class array What array? You need to post the exact class declaration instead of making us guess what you are doing. | |
Re: The first thing you have to do is design the structure. What information is on each line of the file? You can't do anything else until you figure that out. | |
Re: Reading the information from the data file is very much similar to how you have it coded now to get it from the keyboard. The only difference is that you have to open an ifstream object. [code] ifstream in("infile.txt"); int i = 0; while( in >> studentInfo[i][0] ) { in … | |
Re: Nice, but don't walk around their lawn in bare feet :) If you have ever stepped on a wet pasture pattie with bare feet then you know what I mean. | |
Re: Why did you put all that C code inside a C++ program? I realize C++ supports FILE* and associated functions, but if you want to write c++ then do it the right way using fstreams and other c++ classes. | |
Re: To find both row and column, start the function out by setting both values to 0, and [b]temp[/b] to the value of whatever is in a[0][0]. Then if the value in a[i][j] > temp (note: not >=) change the value of all three variables -- temp, row, and col. | |
Re: [QUOTE=cristane;839655]We all know that Obama has made it clear that he is going to make restrictions on outsourcing businesses. If implemented then that means trouble for many countries that relies on outsource businesses like call centers and other businesses. Do you think it’s a sound decision made by him?[/QUOTE] Yes, … | |
Re: >>unsigned short int If you are compiling for UNICODE you should be using wchar_t datatype for portability. *nix computers define wchar_t as unsigned long int, which is obviously not the same as MS-Windows. And the last time I read the UNICODE standard was considering a 64-bit integer so that it … | |
Re: There is none. [URL="http://www.cs.bu.edu/teaching/cpp/polymorphism/intro/"]Here is an explanation[/URL]. | |
Re: create an OnTimer() event handler that updates the box. | |
Re: >>Is there an easy/fast way to convert C++ with class structure, etc to C? No. First convert the class to a structure and remove all its methods as well as access rights (public, protected, private). If it has base class(s) you will have to remove them too. Next, convert class … | |
Re: compiling on a 64-bit operating system is not sufficient -- you have to build it with a 64-bit compiler. | |
Re: >>but i seem to be encountering some problems. Do you mind explaining what problems? Do are we supposed to guess? | |
Re: >>if (answer1 == 'Leave') answer1 is just a single character and you are attempting to compare it, illegally by the way, to a string. You need to make answer1 a character array and use strcmp() to compare it to a string. Or you could make answer1 a std::string object, since … | |
Re: Please seee post #11 in [URL="http://www.daniweb.com/forums/thread193067.html"]this thread[/URL] because its the same problem. | |
Re: because no memory has been allocated to aSome -- its nothing more than a pointer that has a random address. | |
Re: What operating system (and version) are you using? You may have to go to Tools --> Compiler Options --> Directories also in Programs tab, then add the full path to all files and programs | |
Re: what the hell! :-O Am I the only one who has absolutely no clue what he wants? | |
Re: I think he needs to write a calculator program that uses reverse polish notation. | |
Re: I think a name change would be a great idea :) John Doe or Bill Smith would be a good names to inherit. >>and i wont feel like foreigner each time i am asked what my name is But you are a foreigner. Technically we are all foreigners except the … | |
Re: [URL="http://www.codeproject.com/KB/wtl/WTLExcel.aspx"]Here[/URL] is one way to do it , I think, without the complications of COM. The GUI interface is probably not what you want but you can extract the ideas that document presents. | |
Re: The link you gave is some sort of download page written in some language I don't know. attach your project to your post here at DaniWeb. Just use WinZip to zip it up, press the Go Advance button in the "Quick Reply To Thread", then the "Manage Attachments" button. This … | |
Re: OMG what a resume!;) Welcome to DaniWeb, glad you are with us. | |
Re: Great! start typing :) And welcome to DaniWeb. | |
Re: All of the problems with the code you posted are due to carelessness -- misspelled words. When programming you have to learn to pay attention to small details, such as capitalization and spelling. Look at your compilers error messages and fix the problems one at a time. Normally the first … | |
Re: answer: [icode]ifstream in("filname.ipg",ios::binary);[/icode] | |
Re: [code] int** foo() { int i; int** array = malloc(100 * sizeof(int *)); for(i = 0; i < 100; i++) array[i] = malloc(20 * sizeof(int)); // allocate 20 integers return array; } int main() { int ** array = foo(); } [/code] | |
Re: [QUOTE=cool_zephyr;870650]hey..will anyone tell me how to browse files and folders in a drive using C??[/QUOTE] Depends on the operating system. [list] [*]MS-Windows: FindFirstFile() and FindNextFile(). [*]*nix: opedir(), readdir() [/list] Google for those key words and you will find more information about how to use those functions. | |
Re: So, what is the question? To replace the switch statement with a set of if statements [code] if( property_code == 'R' || property_code == 'r') { } else if( property_code == ??? etc. etc. [/code] | |
Re: [QUOTE=iamthwee;871348]This didn't compile without problems for me.[/QUOTE] Remove all those comments at the top, then it will compile -- at least it did with vc++ 2008 express. I don't have time this morning to debug the code. My suggestion to the OP is learn to use your compiler's debugger and … | |
Re: who or what is libJudy? (don't tell me its a library because I already guessed that :) ) | |
Re: You really need to fix the problem instead of trying to hid it.Try commenting out large blocks of code until the program no longer produces those errors. That will narrow down your search for the problem. | |
Re: first copy the nodes in each queu until either A or B are empty. After that copy the nodes in the remaining tree until it is empty. If the nodes of each queue are the same structure then you can just copy the address of the nodes from A and … |
The End.