49,757 Topics

Member Avatar for
Member Avatar for jackmaverick1

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 …

Member Avatar for jackmaverick1
0
142
Member Avatar for smurfy

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 …

Member Avatar for nina@cika
0
348
Member Avatar for learner guy

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 …

Member Avatar for Schol-R-LEA
0
235
Member Avatar for namratag
Member Avatar for MasterHacker110

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: …

Member Avatar for MasterHacker110
0
88
Member Avatar for Vasthor

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 …

Member Avatar for Vasthor
0
244
Member Avatar for acmarshall

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 …

Member Avatar for acmarshall
0
313
Member Avatar for dinamit3

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<<" : "; …

Member Avatar for Schol-R-LEA
0
213
Member Avatar for LevyDee

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 …

Member Avatar for mrnutty
0
108
Member Avatar for jankeifer

[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* …

Member Avatar for cahitburak
0
136
Member Avatar for qmanchoo

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 …

Member Avatar for Moschops
0
112
Member Avatar for Gregor007

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 …

Member Avatar for WaltP
0
156
Member Avatar for EvaL2ne

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 …

Member Avatar for WaltP
0
316
Member Avatar for khanthegamer

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] …

Member Avatar for khanthegamer
0
151
Member Avatar for snowhite89

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 …

Member Avatar for Moschops
0
263
Member Avatar for stereomatching

[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, …

Member Avatar for stereomatching
0
325
Member Avatar for jeevsmyd

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?

Member Avatar for jeevsmyd
0
70
Member Avatar for jeevsmyd

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 …

Member Avatar for Schol-R-LEA
0
547
Member Avatar for ztdep

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

Member Avatar for Ancient Dragon
0
45
Member Avatar for Tahmod

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 …

Member Avatar for Schol-R-LEA
-1
269
Member Avatar for stereomatching

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 …

Member Avatar for stereomatching
0
121
Member Avatar for Hiiero

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 …

Member Avatar for jmichae3
0
171
Member Avatar for Labdabeta

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)

Member Avatar for mrnutty
0
298
Member Avatar for sangkun

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 …

Member Avatar for vijayan121
0
1K
Member Avatar for stereomatching

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()> …

Member Avatar for stereomatching
0
285
Member Avatar for jeevsmyd

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 …

Member Avatar for WaltP
0
170
Member Avatar for sangkun

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 …

Member Avatar for Clinton Portis
0
179
Member Avatar for jefgreen

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; …

Member Avatar for jefgreen
0
196
Member Avatar for Dman01

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 : " …

Member Avatar for Dman01
0
680
Member Avatar for kaoss1103

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 …

Member Avatar for v3ga
1
2K

The End.