49,761 Topics
| |
Hi, I need help writing a program for the powerball game. so this is what i have so far. I am having difficulties in comparing the numbers generated and the numbers entered by the user. This is what i have so far. [CODE] #include <iostream> #include <cstdlib> #include <ctime> using … | |
Hello, i want to ask, messing words in array is a good way to encrypt data? or can someone very easy to brake it here is an example [CODE] #include "stdafx.h" #include <fstream> using namespace std; // Decleration for functions void EncryptFile(char c[], int key1, int key2); void DecryptFile(string filename, … | |
I have to read numbers from a .txt file and sort them. I am trying to use selection sort. The .txt file looks like this: 3 33.3 92.5 4.5 6.29 5.3 94.3 -7.455 4.66 -9.33 -211.2 .03 .12 0.34 4.83 2.494 I am now working on the first 5 numbers … | |
Hello every body I'm trying to iterate through a list for a certian number of times using a for loop. below is the current code I've written, but this will iterate through the list until it ends. [CODE]list<FileInfo*>::iterator p = currentlist.begin(); while(p != currentlist.end()) { cout << (*p)->remainingtime << " … | |
Hi all! I am quite new to C++ and just been hacking with stdlib. When I want to start hacking other things outside stdlib, like network aso. I get confused and can not find what I am looking for. I use GNU/Linux and want to use "native" libs for that. … | |
I want to make a program that makes and extracts tar files from scratch a other sit said that using wikipedias specifications it's easy but I don't know how to do half that stuff! Like makeing the thing to the right size moving where it writes and reads to. Making … | |
I am trying to extract data from multiple files into one output file. At the moment I am able to extract the columns I want into a vector in a vector: [code] vector< vector<double> > out; //2D vector ofstream myfile ("example.txt"); //outputfile //the data contained in data[n][6] is put into … | |
[CODE]#include<iostream.h> #include<conio.h> #include<process.h> struct node{ int data; node *next; }; class Linklist{ node *ptr,*save, *head, *tail; public: void ncreate(); void display(); void insert(); }; void Linklist:: ncreate() { while(1) { ptr = new node; cout<<"enter info:"; cin>>ptr->data; if(ptr->data==-999) { return; } if(head==NULL) { head=ptr; tail=ptr; } else { tail->next=ptr; tail=ptr; … | |
What is the meaning of attributes defined by boost::spirit? [code] namespace qi = boost::spirit::qi; qi rule<std::string::const_iterator, double()> simple_rule = qi::double_ >> *(',' >> qi::double_); [/code] only double_, int_ equal to attributes or ',' also is an attribute? Thanks | |
Netbeans is a free, open source IDE for developing software in Java. It's been around for almost 15 years, having gotten its start around the time Java began. Version 7.0 is about to be released, and I got my hands on the Beta release of this new version. In the … | |
Hi all, Sorry if this is a stupid question. Assume I have a code like this. [CODE] char *temp = "poiuytrewq"; std::cout<<*temp<<std::endl; //should print p function(temp); std::cout<<*temp<<std::endl; //should print i [/CODE] Basically my function() in the above snippet increments the pointer twice so that temp point to 'i' now. I … | |
I'll keep it simple and hopefully whatever simple error I keep overlooking can be used as a learning experience for others. This program uses a user created file called patient.dat that contains the following: Smith Eleanore 110/73 Jones Tom 200/78 The error I am having is that Mr Tom Jones … | |
Hello everyone, Like the headline says, my computer goes crazy when I run this program. The problem did not occur until I added lines 80-83. When the program is run, my computer starts beeping and weird characters show up on the console. Any thoughts on the problem and why it … | |
I don't know what this problem is asking me to do : initialize both i and n in the same line. Initialize n to 0, and i to 0. This problem is in the Loop Chapter: for (int i = 0; i <= 5; i++) cout << i << " … | |
[B]i want to open atleast 5 text files using switch case.pls suggest me a program[/B] | |
hi! can someone help debug my codes? getline() works properly in my main() but if i'm putting it to another function, it ignores the first getline() w/o entering any words and goes to the 2nd getline. my program works like this: i have a menu() that lets the user to … | |
Hello, I am currently doing an assignment where I have to read numbers from a .txt document into an array and later find the average of different lines of the .txt document sort them and what not. I'm not even close to the ladder parts of this assignment and I … | |
ok so in my program i'm supposed to read data from a text file and store it in arrays then make calculations from my array. so there will be three functions for the program 1 will be the readfile() which will read the file the other will be calculatedata() which … | |
Im writing a program that uses sockets for inter process communication however i have come to a road block and cant get my code to compile. i have googled all the errors with no luck finding a solution. If any one can help me it would be appreciated. Here is … | |
im trying to print the array 5 times, each time containing different numbers but it repeats the same random numbers. help please. [CODE] while(count<5){ fillarr2(ran1,ran2); printar(ran1,ran2,counting); } // functions void fillarr2(int raa[],int rab[]){ int ran1,ran2, i,count=0; srand(time(NULL)); for(i=0;i<10;i++){ ran1=rand()%15+1; raa[i]=ran1; } for(i=0;i<10;i++){ ran2=rand()%15+1; rab[i]=ran2; } return ; } void printar(int … | |
This program is suppose to input a date and output the day of the week that corresponds to that date. I have the program all done, but the code is not presented in the main() of the form. Im guessing i have to organize it a little more. any ideas … | |
I need some help with a code I'm writing. The user inputs some letters, a loop is ran to check if it's a vowel or consonant, then when the user is done it returns the total amount of vowels and consonants. The problem I'm having is the loop is suppose … | |
I am trying to print out a chess board on the console. The data structure i am using is a set of pairs. I am having trouble accessing the pair's elements. I do realize a map is probably better in this case but i am using somebody else's code so … | |
So, here I am again, with my mass of code, albeit with more progress. It's still got a long way to go, and I'm still not that good at coding, but man oh man have I learned a lot through this game. I come with a few more questions than … | |
I made my console application up in Visual C++ 2010,have a icon for it,but don't know how to place it.I know it's not important and that i can use additional software for that, so answer directly, i just want to know. Thanks ! | |
Hi, I would like to know how to add the objects of a vector?I wrote a code where it is adding the values to a specific object.I wanted to write a code where it can add all the values of all objects in a vector? | |
Hi, I am learning C++ and am writing a program to create a Unique List of words. I am having problems getting my struct count field to increment in my createUnique function. After returning from the Search function, the count field within the struct needs to increment if the key … | |
Hi all, I got a problem.I got to make a program that sorts the digits inside a number given by the user, but I can't use an array. I know that the easiest way is with the bubble sort but I can't seem to make a switch between two digits … | |
recommend using for singly and doubly linked lists? |
The End.