49,761 Topics
| |
Respected Users. I am implementing a kind of hash table in my simulations. I have a message which contains (Timestamp, Random Number, and Location (x,y)) information. Now i need to calculate [B]H(Timestamp||Random Number||Location). [/B] I have no idea how to do that and need some starting point and help in … | |
Well, I am currently learning Qt and I develop on two systems, a Mac OSX 10.5 and Ubuntu. I decided to make a small app with the default template in QtCreator (Qt4 GUI app). I put some menubar entries, and the last entry "Exit" is separated by a separator. While … | |
Hello, I have a file where the data layout is known. Suppose it's like this: image1 SomeData ... image1000 SomeData ... I want to get an access to the line I want without the necessity to move across all the lines. Let's say I wanna access directly to the line … | |
I wanted to know if there is a function in visual studio C++ 2005, that is called on if your mouse hovers over something, and how to use it? | |
Hello, I'm having a bit of trouble figuring out how to get C++ to output something to a text file. Any help would be very appreciated. Here is the code: [code] //THIS PROGRAM IS INTENDED TO GENERATE THE SQUARE ROOT OF AN INPUTTED NUMBER USING A WHILE LOOP AND A … | |
Hey guys I have a almost seemingly trivial problem yet its probally so simple. No matter how hard i try I can never seem to get the format of the cout statements to look they way i want. I always use the setw command and set precsion, even the left … | |
Good evening everyone, I have been working on a base\derived class C++ program in which I am trying to compare the areas of a couple of Rectangles, and once I get past the errors I am currently having, I wouldn't mind comparing the Square to the rectangle, but first things … | |
i know there are many ways to hide a console window,but all of them that i test ,they all pop for a second and disapear,how can i do so its doesnt pop at all ??? | |
I'm supposed to output a program that comes out like this: [URL="http://img638.imageshack.us/img638/4135/screen3t.jpg"]http://img638.imageshack.us/img638/4135/screen3t.jpg[/URL] And here is the top part of the code. It is supposed to read a .txt file that has the numbers of the: flight; passengers; and miles; [CODE]int flight, passengers, miles; float income, cost, profit, base, fuel; ifstream … | |
how can a make the floating variable show just 4 digits i mean : 8.6540098 to just 8.654 i guess what i'm trying to say is "less decimals" :D | |
[CODE] #include<iostream> #include<fstream> #include<string> using namespace std; void main() { //decleration ifstream source; ofstream target; char * box; int width, height, numlevel; string s; int amount= 100; //-------------------- source.open("1.ppm",ios::binary); while(source.fail()) { cout<<"can not open the file"<<endl; // to make sure the file is opened } source>> s; if ( s … | |
heelllo i am trying to upload a file to a ftp server,here i smy code: [CODE] HINTERNET internet; HINTERNET ftp; internet = InternetOpen(NULL , INTERNET_OPEN_TYPE_DIRECT , NULL , NULL , 0); ftp = InternetConnect(internet , "127.0.0.1" , INTERNET_DEFAULT_FTP_PORT , NULL , NULL , INTERNET_SERVICE_FTP , 0 , 0); bool x … | |
Hey guys, i am having a problem in getting to store data in a text file. I have a certain text file which contains data in this format... [CODE]Jimeno Rames James Kimon[/CODE] what i am tryng to do is to store each line into a seperate value. The problem i … | |
I can't seem to wrap my head around what I'm doing wrong. I'm trying to create an N-ARY tree. I'm pretty sure I'm close. But the nodes are filling wrong. I have used cout to output the nodes as they fill and sometimes the nodes are filling with the same … | |
Hello everyone, I have a question regarding advanced file manipulation. I am trying to make a function that will take in a number which will be the number of a record and basically take that record out and display its contents and let the user edit it. Here is the … | |
[CODE]map<string, int> Employees; Employees.insert(map<string,int>::value_type("John A.",7582)); [/CODE] what does the value_type do? what is the difference between pair() and make_pair() | |
hi I am having VC++ 2008 express edition downloaded few days before....will you please help me how to compile c++ source file,debug and run it....pls....hv no time to read dat help topics...pls help me out!! | |
i need help in writing c++ program by using classes ???? | |
Hey guys. I'm having some issues with my Visual Studio 2008 Pro. I'm trying to compile the following code, included in the link [url]http://pastebin.com/r6WsG5r7;[/url] but, whenever I try compiling the code, I get like 5 erros: The errors are listed below. Why is it that moving certain declarations around changes … | |
Hi all, I need to write a program that will first read a file and then 1. Output all the words that appear in a file. 2. Treat only sequences of letters and digits as words, i.e., all other characters such as punctuation marks should be used as word delimiters, … | |
[QUOTE]Hello..can anyone help me in order to solve this problem regarding the collision that happend.. I use the modulo-division hash function and intended to use the chaining solution method to resolve this collision but i got stuck.. because i dont really have the full knowledge in link list..Can someone that … | |
Hey,have been having a problem with this code,dont no what to do here,trying to find the letter in the secret word in hangman.when the user inputs their choice how do i compare it with the secret word.was using a for loop but not sure [CODE] cout<<"\n\t\t *********** H A N … | |
Hey all, I got interested in using smart pointers and tried to implement the following solution: [URL="http://www.davethehat.com/articles/smartp.htm"]http://www.davethehat.com/articles/smartp.htm[/URL] It's probably far from perfect but this is mainly a learning experience. It's a non intrusive reference counted implementation of a smart ptr. And somewhere in the article the assignment operator is defined: … | |
Hi everyone I am a C# programmer but recently I faced a problem which i guess it would be solved using C++ ( still not sure!!!) I want to have the list of data type definitions existing in native windows kernel module. I would be appreciated if anyone could give … | |
i have the following code: [CODE] HWND window; char name[MAX_PATH]; while(1) { window = GetForegroundWindow(); GetWindowText(window,name,sizeof(name)); strcat(name , "\n"); WriteToFile(name); } [/CODE] i just want to print it once,and if i open a new window,print that too,once....and so on.....and i dont know what condition to put to work corectly :( | |
Hi guys, In my lab I was given a source code and was tasked to write the function to compute the largest value of a vector, and a for loop to show how elements does the vector has.But the output is now right,it gives me the largest element is zero,and … | |
It's been about a year since I've used C++, and I'm having a weird error that I can't remember why it does this, or if there's actually something wrong. My destructor gets called twice when I declare my object via the first method, and only once (correctly) when it declare … | |
I haven't got any luck finding why this program wouldn't work. Here's the code. [CODE]int main (void) { ifstream file; char *streamer = NULL; file.open("now.txt", ios::in | ios::binary); if (file.is_open()) { while (!file.eof()) { streamer = new char[33]; cout << "Prestream: " << streamer << endl; file.read(streamer, 32); cout << … | |
here is code[ [CODE]#include<iostream> #include<fstream> #include<conio.h> using namespace std; struct book_dtail { int copies; char title[50]; char author[50]; int year; char **bn; }; void main() { int size; ifstream indata; book_dtail user_book[5]; indata.open("file path to be added here"); for(int count=0;count<5;count++) { indata>>size; user_book[count].copies=size;//2D array initialized. user_book[count].bn=new char*[size]; for(int temp=0;temp<size;temp++) { … | |
I wanna know how 2 return string by using function for example if we want to check the lenght of string we use cout<<strlen("c") but how to use this by fuction |
The End.