15,300 Posted Topics
Re: What program are you using? Microsoft Word maybe? If yes, what version? | |
Re: >The second isn't being increased by 4 bytes from the ptr. Yes it is. 945c + 4 = 9460 (5c+1=5d, 5d+1=5e, 5e+1=5f, 5f+1=60) | |
Re: you also need to replace iostream with stdio.h, add .h extension to the other includes, delete like 4, and replace cout with printf() | |
Re: They do not both work the same. calloc() initialized the memory block with all 0's while malloc() does not. And they do not have the same parameters. | |
Re: It's just a simple inline method, or you can put the implementation code in the \*.cpp file if you wish. class SavingsAccount { public: friend ofstream& operator<<(ofstream& out, SavingsAccount& obj); friend istream& operator>>(istream& cin, SavingsAccount& obj); public: string firstName; string lastName; float savingBalance; float annualInterestRate; int objectnumber; void operator+=(int val) … | |
Re: remove the word **typedef**. I hope you realize that will create a non-null-terminated array of characters. You can't pass it to any of the functions in string.h. A better and easier way to declare it is like this: `char alphabet[] = "abcdefghijklmnopqrstuvwxyz";` | |
Re: My PC has a lot of external devices connected to it, I don't see how a tablet could possibly do that. The tablet I have has only one port -- to tether to a PC or recharger. | |
Re: >Do I need a header file and a .cpp file both to use a custom defined class? Depends on the how complex the class is. In the simplest case the class and implementation can both be in the header file. I like to use inline for very short methods. For … | |
Re: That explains a great deal :) You are using Turbo C because you are a hobyist, not a student who is forced to use it by his/her university. Sorry, but I can't help you either because I havn't used it since about 1987 myself. If you are still trying to … | |
Re: I'm using IE11 and I see that but in a circle, it's a square like you showed in the member's Profile page. It looks like that on Chrome too. My guess is that's the way it's supposed to be. ![]() | |
Re: Where did you get that algorithm? [Here'](http://cforbeginners.com/ssort.html)s another for you to study. | |
Re: depends on data type sUserName -- string iUserID -- integer I don't write php or java, just c and c++. | |
Re: typecasting doesn't work. You use the macro toupper() on each character in the string (use a loop) Example char c = 'a'; c = toupper(c); // convert to upper-case printf("%c\n", c); | |
Re: calloc is the same as malloc but calloc initializes the memory to all 0s Both these are the same int *array = malloc(10 * sizeof(int)); for(int i = 0; i < 10; i++) array[i] = 0; The above can be rewritten with this one line: int *array = calloc(10, sizeof(int)); | |
Re: line 5 is undefined behavor, the value printed for i may be difference from one compiler to the next. | |
Re: Is that supposed to be written in java or c++? There is a java form for such questions. In either event, no one here will do your homework for you. Post the code you have written and ask questions about what you don't understand. It is YOUR responsibility to do … | |
Re: The only program I miss from XP is the original version of [Diablo RPG](http://en.wikipedia.org/wiki/Diablo_(series)). There are several MS-DOS games I liked. Otherwise, I don't miss a thing from XP. | |
Re: ListBox has a FindString() method. When you enter text in the textbox, pass the text on to ListBox.FindString(). If you need anything more complex searching then that, I'm afraid you will have to do the work yourself as deceptikon said. | |
Re: Use a friend method to overload those operators, for example #include <iostream> #include <fstream> using namespace std; class SavingsAccount { public: friend ofstream& operator<<(ofstream& out, SavingsAccount& obj); public: string firstName; string lastName; float savingBalance; float annualInterestRate; int objectnumber; ... ... }; ofstream& operator<<(ofstream& out, SavingsAccount& obj) { out << obj.firstName … | |
Re: >first line is pointer to an array of 5 integers Those are char pointers, not integers. The first line declares an array of unknown number of pointers, each pointer points to a memory block of 5 bytes. The second line allocates a single block of memory with size n*5. This … | |
Re: And if you use QT compiler you can have one set of source code for both \*nix and Windows, AFAIK you won't have to rewrite anything to change from one os to the other, just recompile. | |
Re: Post the code you have written so that we can see where your "issues" are. | |
Re: objects can't be declared in case statements without { and }, for example: switch(choice) { case 1: { ifstream levelOne; levelOne.open("level1.txt"); } break; That also means that the stream will be closed as soon as the break statement is executed and the switch is exited. I think you need to … | |
Re: Any first year C programming student should be able to answer that question. If you could not then you are not yet ready to work as a professional programmer. | |
Re: The problem appears to be in this function `ListNode *LinkedList::insert(ListNode *item, ListNode *sortedList)` That function is destroying the original list. It should be inserting item into SortedList and returning SortedList. Instead, it is doing just the opposite. One way to solve the problem is for insert() to create a new … | |
Re: Your options are somewhat limited, but [here ](http://www.easysoft.com/developer/languages/c/odbc_tutorial.html)is an ODBC tutorial | |
Re: Good. Now get a college bachelor's degree and you will be on your way. | |
Re: [QUOTE=IT seeker;1083064]what is the code of ms office in c++??//[/QUOTE] Send Microsoft a Billion dollars USD and they MIGHT let you see it. | |
Re: The metod that starts on line 92 is a copy constructure, which means you have to create a copy of the contents of the parameter. In this case you have to copy the contents of the list from **other** parameter into **this**. A simple one-line statement is not sufficient. | |
Re: [QUOTE=jbennet;334294]rofl i disklike c++ myself, but i appreciate its importance they should make a better c++ and call it D that would be cool (and yes ive tried c# and c++.net and dislike them also)[/QUOTE] They'd have to call it E or something else because there already is a D … | |
Re: The constructor needs to duplicate the items in the parameter. Iterate through each of the shapes in list parameter and call list2.Add() method to add the shape to list2. Since you have already coded other functions that iterate through all the shapes this constructor should not be all that difficult … | |
Re: what compiler are you using? Turbo C has a goto() function that moves the cursor somewhere then you would just print spaces. If you are using a more modern compiler then you will have to use some of the win32 api console functions to move the cursor to the beginning … | |
Re: You could sleep in a motel or hotel, but at $200/day that would cost you $3600.00 USD. Campervans get terrible gas milage, gas costs about $3.60/gallon. Get a Toyota Prius which gets about 52 miles/gallon (I own one and is one of my favorite cars). Next make sure you dress … | |
Re: For char arrays you can use strcmp() which is defined in string.h to check if the two character arrays are the same or not. strcmp() returns 0 if the two are identical. `if( strcmp(str,"hello") == 0) cout<<"world";` | |
Re: I think the problem is line 36. freenode is the new node to add to the head of the linked list. all you have to do is this: freenode->next = top; top = freenode; line 45: you need a `break` statement before the next case. line 11: main() always always, … | |
After the time has expired to edit a post can you just remove the Edit Post button? It's somewhat confusing to make changes then no Save button. | |
Re: You mean you wanted until the day before the assignment is due to get started?? Good luck. | |
Re: the clipboard is the operating system (Windows) way to copy/paste. You can copy from one process and paste it in the same or another process. Similar concept to shared memory in linux os but not nearly as versatile. | |
Re: try [this](http://www.infolet.org/2012/10/how-to-get-turbo-cc-in-full-screen-on.html) | |
![]() | Re: Move the include statement down below to line 4, after the ifdef statement. Yes, you can put include statements in header files, it's done all the time. |
Re: You don't compile each module down to \*.exe, but instead just to object module then use the linker to link both object modules together at the same time. And you should be creating a console project, not a Windows project. The error you posted indicates you created the wrong kind … | |
![]() | Re: how about `SELECT * from table where projectNumber is not NULL` |
![]() | Re: Read [this page](http://sourceforge.net/apps/trac/libusb-win32/wiki), which is a windows port of the library. Since you are already using it in Ubuntu you should have little or no difficulty using it in Windows. As for VS2010, there is nothing different about it than there is about using any other 3d party library. It's … ![]() |
Re: Post your code, the diagram you posted is not very helpful to find the problem in your program. My guess is that the pointer you used was not initialized to a specific address before dereferencing it. For example int k = 123; // original integer int* p = &k; // … | |
| |
![]() | Re: They are correct -- you can't duel boot both. But you can use a [VirtualBox](http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html?ssSourceSiteId=otnjp) and install it there. ![]() |
Re: You can't. You need a 32-bit or 64-bit compiler to do that. Turbo C++ is just too old |
The End.