49,757 Topics
| |
The error I'm getting makes NO sense seeing as I'm defining the functions it's confused about directly above. The error: undefined reference to `accMan()' undefined reference to `bookMan()' undefined reference to `lend()' undefined reference to `getBack()' undefined reference to `tellMenu()' undefined reference to `tellMenuAcc()' undefined reference to `tellAllBooks()' undefined reference … | |
Hi, In Visual Studio CLI. I have randomly generated numbers which are a,b,c,d . One by one they are meaningless . Together they create a color code for different products. For example : id | a | b | c | d | i | 1 | 1 | 5 … | |
hello everyone, i am trying to implement save,load and replay in my chess game made in c++ console. i am done with save and load but stuck on replay. i want every turn to be stored in file and when player asks to replay it should show all turns in … | |
My enscription program enscripts the words in a text file, but when I descript it is all mixed up eg. Origanal text: Name: Master Surname: Hacker Age: 1101 Enscripted text: 6BX5 6BX5 + BX0 6BX5 + BX0 9BXIIHI Descripted text: Name: MasteName: MasteName: MasteName: MasteName: MasteSuName: MasteName: … | |
these code, I expect they work the same. using Code::Blocks as the compiler, the result is differ result = output 10 return 0 [CODE] #include <iostream> int main() { int i = 0; while(i < 10) ++i; std::cout << i << std::endl; } [/CODE] result = compile error. [CODE] #include … | |
Given a multiple-choice test of 10 questions with 5 possible choices (A-E). The answers are given in a text file a long with the student names. Write a C++ program that does the following: 1.Reads the key answers to an array from the input file. The key is the first … | |
How can I memory N words using only pointers[Dynamic Memory] ? I tried something but I believe it's not well coded. [CODE]#include<iostream> using namespace std; int main () { char **a; int N; cout<<"Enter the number of words = "; cin>>N; for(int i=0;i<N;i++) { cout<<"Enter word number "<<i<<" : "; … | |
For the life of me, I can't figure out what I am doing wrong! It has been sometime since I have had use for my own list type, but since std::vector is pretty worthless for what I need it to do, I need to relearn templates. [code] #include <memory.h> template … | |
[CODE]#include <iostream> #include <iomanip> #include <map> #include <time.h> #include <cstdlib> using namespace std; //displays the instruction of the game void displayInst(){ for ( int b = 0; b < 28; b++ ) cout << "* "; cout << "\n* Game Title: NUM-BERS *"; cout << "\n* *"; cout << "\n* … | |
Disclaimer: the following question is not for homework or a class assignment....just practice I'm am trying to load an array with a file extension, based upon user input. The proper extension is present in the function, but when I print in main() to test, all I get is junk. This … | |
There's the text given (Duomenys.txt). The program removes vowels of the longest words in each line. How do you redo the program to find numbers in the line (starting with -+0123456789) and insert the word NUMBER before these numbers (in the results file). [CODE]const char Cduom[] = "Duomenys.txt"; // data … | |
In file i have a text. Words form line to line dont raising. Word in line separate least one space.Spaces can be at line begining and ending, can be empty lines. Count how many words can be in real number. i need a function whitch can count words whitch can … | |
The code posted below is giving an unusual error which i cant get to figure out. According to me the error is caused by the definition(or maybe by the initialisation of the string array). The error is comin in the vending.cpp file in the initialisation of the [I]product[10][/I] array [CODE] … | |
Hi.. can anyone help me.. I having problems in displaying the output read from an input file. when I run the code, it only display the output of the first character in the input file. Anyone can help me figure out the problem? & I'm using borland. [CODE]#include <iostream> #include … | |
[code] #include<iostream> #include<string> #include<vector> #include<boost/spirit/include/phoenix.hpp> #include<boost/spirit/include/karma.hpp> struct test_spirit { void read_function(std::string &result, std::string const &val) const { if(result != "memo_zero") result += val; } }; void spirit_01b() { std::vector<std::string> data; data.push_back("memo_zero"); data.push_back("memo_two"); data.push_back("memo_three"); std::string temp; test_spirit ts; karma::generate ( std::back_inserter(temp), ( karma::string[phoenix::bind(&test_spirit::read_function, &ts, karma::_1, karma::_val)] << ", " ), data, … | |
I'm using Turbo C++ v3 and I want to convert a string which contains hexadecimal numbers into a decimal integer. How do I do that? | |
For my SIC assembler written in C++ , I need a hexadecimal integer as the location counter. That is if LOCCTR=A and LOCCTR++ should store B in LOCCTR. Is there such an variable in C++? If so how do I make it Hexadecimal?? I know how to Initialize an int … | |
Dear friends: I wrote my c++ console program with vs2008, and everthing is ok. But i open it with vs 2010, the consol window dispear after the code run.I can not see the output resutls in console window. could you please help me out. Regards | |
Hello, This is the program that I need to do: Write a program that will sort an array of 20 integer numbers into descending order. The results must be displayed on the screen in one column. I tried this, me totally confuse. :| I tried to do this program for … | |
I would like to generate output like this common, int, optional video, double, optional by karma with the structure [code] struct attr_struct { std::vector<std::string> name; std::vector<std::string> type; std::vector<std::string> use; }; [/code] So I defined some rules for it [code] #include<iostream> #include<string> #include<vector> #include<boost/fusion/adapted/struct.hpp> #include<boost/spirit/include/karma.hpp> namespace karma = boost::spirit::karma; namespace karma … | |
Can I not do the below code? [CODE] class box { public: box(){} box(int v){x=v;} ~box(){} int getx(){return x;} private: int x; }; ____________________________ #include <iostream> #include <queue> #include <cstdlib> #include <ctime> #include <windows.h> using namespace std; #include "Q4.h" int main() { queue<box> B; int a; cout<<"How many boxes would … | |
I am really confused as to the purpose of the unary + operator. What in the world does it do? I have tested it and it doesn't return the absolute value. Does it just return the operand? And if so what purpose is it?! (I mainly care about integer types) | |
Hi, The program I'm trying to make is to transcribe DNA to RNA and separate into codons. So far I was able to transcribe DNA to RNA and store it in string variable. Next part is to separate RNA strand into groups of 3 (codon) and store each group in … | |
I take some codes from [url]http://boost-spirit.com/home/articles/karma-examples/output-generation-from-a-list-of-key-value-pairs-using-spirit-karma/[/url] But it wouldn't compile My compiler : vc++ 2010 os : win7 64bits [code] #include<iostream> #include<string> #include<boost/optional.hpp> #include<boost/spirit/include/karma.hpp> namespace karma = boost::spirit::karma; namespace phoenix = boost::phoenix; int main() { typedef std::back_insert_iterator<std::string> sink_type; karma::rule<sink_type, std::string()> base = karma::string; typedef std::pair<std::string, boost::optional<std::string> > pair_type; karma::rule<sink_type, pair_type()> … | |
I want format out in cout , similar to the way printf supports the functionality. I read that iomanip can be used for that purpose. But the problem is at college we have to do in the ancient Turbo C++ and I dont think it has iomanip. I'm making an … | |
I don't know a way to enter string into a vector. For example, there is string s = "augcuuaucaca" and I want to separate the string s into groups of 3 characters such as "aug", "cuu", "auc", "aca" and each group of characters would be string type. After that, I … | |
For some reason, my program will not let the user enter his/her row number. Here's the code: [CODE]#include <cstdlib> #include <iostream> #include <iomanip> using namespace std; int a=0,A=0,b=1,B=1,c=2,C=2,d=3,D=3,e=4,E=4,f=5,F=5; void ticketchoices(); void displaychartfirst(char firstclass[2][6],int ticketnumselection); void displaychartbus(char busiclass[5][6],int ticketnumselection); void displaycharteco(char ecoclass[6][6],int ticketnumselection); int main(int argc, char *argv[]) { char X; … | |
Hi The following code shows good enough how to multiply two long data [CODE]long x = 10, y = 3; long p = 0; while (y > 0) { if ((y & 01) != 0) p += x; x <<= 1; y >>= 1; } std::cout << "\nResult : " … | |
I have just started programming in c++ (yesterday), my background is in HTML, CSS and Javascript. i'm on chapter 5: controlling program flow (c++ for dummies) currently creating a break in a "for loop". Anyway'z my problem is, when i build and run the program all action's i want the … |
The End.