49,761 Topics
| |
Will the older c++ commands (leaving that of conio.h) work with a new compiler like g++ if i use "using namespace std;" and use 'int' with main() rather than 'void' and don't use .h for including a header file? | |
So Basically I have a 4 x 2 array of Chars* that I need sorted alphabetically by the first column only. The Array starting out looks like: [CODE] Choices[0][0] = "CCleaner"; Choices[0][1] = "Utilities"; Choices[1][0] = "SIW"; Choices[1][1] = "Information"; Choices[2][0] = "MalwareBytes"; Choices[2][1] = "Virus"; Choices[3][0] = "CCleanerx"; Choices[3][1] … | |
Sorry guys, am back again with another noob question and hoping someone is nice enough to help point me in the right direction.I've only began to learn this in the past couple of weeks so there is still alot am confused about. Really wish i didnt have to come here … | |
im writing this program for an assignment and im getting errors can anyone help make some suggestions? i have to have the program print out balances for saver1 and saver2 then change the percentage rate then reprint [CODE]//header definition file for savings account #ifndef SAVINGS_ACCOUNT_H #define SAVINGS_ACCOUNT_H class SavingsAccount { … | |
im having trouble pin-pointing why my loop continues to execute infinetley. can someone point out what im doing wrong in my dowhile loop? [code=cplusplus] #include<iostream> #include<string> using namespace std; int main() { string command; char again; do { cout << "Welcome to the Intrepeter!" << endl; cout << "Please feel … | |
I was reading an old thread, [url]http://www.daniweb.com/forums/thread130436.html[/url], and saw the reply [INDENT][I]You are using a compiler with the world's best debugger. You don't need debug messages.[/I][/INDENT] Au contraire. If the problem you are debugging requires window focus to remain unchanged, then hitting break in the debugger will mess things up. … | |
I know that IsValidReadPtr and IsValidWritePtr existed. But I have a friend with a problem and I suggested that he looks at the handle values. Apart from INVALID_HANDLE_VALUE and NULL checking, is there a function which says "Yes, this is valid handle (maybe connected to some object)"? | |
I need to pass part of a string to function: [CODE] string original_string="my_name_original"; string wanted_string (original_string,7); //take "my_name" only my_func(wanted_string, other_var); //func: void my_func(string wanted_string, int other_var); [/CODE] This doesn't seem to work, the compiling was OK but the passed "wanted_string" is empty; When pass char*, it works fine: [CODE] … | |
Hi, If I have a std::vector of objects and I need to iterate through all its elements, is it faster to do: [code] for (vector::iterator i = myvec.begin(); i != myvec.end(); ++i) //blah [/code] or [code] for (int i = 0; i < myvec.size(); ++i) // myvec[i] blah [/code] Or … | |
i am using turboc c++ compiler .how to initialize the graphics drivers .pl let me know. | |
I have data stored in a deque that I wish to write to disk using fstream. So far this is the test code I have written. [code] int j = 10000; deque<double> m_data; for(int i = 0; i < j; i++) { m_data.push_back(i); } std::fstream myfile; myfile.open ("data2.bin", std::ios::out | … | |
I'm trying to solve a cryptarithmetic puzzle TOO + TOO + TOO + TOO = GOOD using a program. My solution to this, is to use a nested loop for each unique letter (in this case T, O, G, D). The loops would systematically assign the digits from 0-9 to … | |
ive implemented a couple of functions for an assignment for class. i have an add function which adds students, id's, and universitys and have "tried" to add a get id function which should search the list, find a specified id, then return it. unfortunately, when i try to run this … | |
Hi at this part of the code at the default constructor codedateInception = 0; dateDeath = NULL: location = 0; I get errors and I know its because they are of a class. I don't know how to set it up to have values. Any help? Header File [code]#ifndef ACTOR_H_ … | |
Hi basically my problem is that I am getting what I believe to be is the address of the object but I want to get the value that is stored in the object. Below is the code I wrote. I've included Date.cpp and my main function file. Say if I … | |
Hello.. I am using visual studio 2010 MFC. in my programm i need to set 4 bit value in hex. exaple: i have hex value 64, it should desplay 0064 A = 000A 3E8 = 03E8 Is there any function in vc++, which set 0 ? Thanks. | |
How is it possible to get the Exception Error as a string in the catch event ? The thing is that I get an exception and now want to know what the problem is and what the exception is saying. [code] try { //some code } catch(Exception ex) { //How … | |
I'm writing a program that parses tcpdump output files. I have a tab delimited text file that contains MAC addresses and hostnames. How can I have the program search this file for a MAC address and then return the corresponding hostname? Any help would be appreciated. Thanks. | |
[code=cplusplus] //////This is a copied code for insertion sort ///// It works for turbo c++ 1 ///// in windows. /// For students of nitc. // The program takes in size of array, and elements and sorts it. #include <iostream.h> #include<conio.h> //#define size 6 void insertion_sort(int x[],int length) { int key,i; … | |
I want to make a map. Suppose the map width is 15 and height is 20. After the map is ready, it would be use to write a map. My code is: [CODE] #include <iostream> #include <fstream> int**map; bool msize(int Height,int Width){ //add code return true; } bool draw_map(char* Filename,int … | |
I got an assignment to be done.. Given a sequence of positive integers. You need to find the number of triples in that sequence. For this problem, (x, y, z) constructs a triple if and only if x + y = z. So, (1, 2, 3) is a triple, where … | |
hello guys...i have a LPTSTR variable and I want to show that on console how do I do that..Here is what I have but, off course it does't work..if it is tooo simple question, plz excuse me...thanx [code=c] lpszDevName = (LPTSTR)((LPBYTE)lineDevCaps + lineDevCaps->dwLineNameOffset); printf("%s",lpszDevName); [/code] | |
I'm a newbie in C++. How can I create a game of tic-tac-toe game using simple codes in C++? Any answers would be much appreciated.. Thanks!:) | |
There is a header file called BITIO.H in C not a standard header file for bit related input output. Is there is similar different or advanced way in C++ to achieve a similar goal? | |
Hi, I am trying to use BOOST threads with SDL. I write a code and run, but the program does not run correctly(i.e i cannot move the output window and i have to force terminate it.) Also during compilation a warning is given as: [b]1>LINK : E:\Program Files\src\threading\example\Debug\example.exe not found … | |
everything worked for me in turbo c++ but not in g++. tell me why do i always have to use "using namespace std;" while compiling with g++? also there is no conio.h, so how do i use the command: getch () then? | |
Hello I tried to delete all the Linked List But I can not so Is there a way to delete the all Linked List? [CODE]struct input { int id; struct input * next; }; typedef struct input ie;[/CODE] [CODE]class input_events { typedef struct input ie; private: ie *l; public: ~input_events(); … | |
Hi im trying to store the current date and time to a file. When i print it, it is in the US format - MM/DD/YYYY [code=c] #include <time.h> _strdate( dateStr ); cout << "Current date: " << dateStr << endl; _strtime( timeStr ); cout << "Current time: " << timeStr; … | |
Hi im writing a function in a program that lets the user delete a specific record in a file, the user is also able to recover this record. The easiest way i found is when the record is deleted, the record will be set to deleted using bool. Then in … | |
I have to make a call-by-reference and I already have all of the program and it works I just have a little problem. I don't know how to get the output to say what I want it to say. It needs to give me the street, city and zip that … |
The End.