General C++ Programming - February 2013 (Page 21)

how to copy between vector <string>
 
hello anyone, btw this is a part of my program void query::load_query(const char* filename){ string lines; int count = 0; ifstream file (filen...
[5 replies] Last: looks like i have found my own solution for this problem :) ......... (by e0ne199)
Generating all possible combinations of a vector elements.
 
I have an integer vector of size "n". e.g. std::vector<int> vec; vec.pushback(0); vec.pushback(1); vec.pushback(2); vec.pushback(3); Now i want to generate al...
[7 replies] Last: [quote=greenleaf800073]Actually, Code::Blocks hosts is capable of i... (by cire)
Help with inflation calculator
 
I need help with making a inflation calculator. So basically the user enter the price of an item,the year of inflation, the percent of inflation. The output is...
[1 reply] : add this loop int main() { blah blah blah... int years = ... (by greenleaf800073)
by LB
Why I love C++11
 
#include <iostream> struct Test { int (*fp)(int a, int b) { (int x, int y)->int { return x*y; }}; }; int main() { Test t; std::cout << (*(t.fp)...
[2 replies] Last: The (int x, int y)->int { return x*y; } is the lambda expression/an... (by LB)
Enable Compiler Options?
 
Hello, This is an error I get, when trying to compile some program: error: #error This file requires compiler and library support for the ISO C++ 2011 stan...
[3 replies] Last: I did not just get... (by greenleaf800073)
by LB
Auto-generate function from typedef
 
I'm looking for something that will let me do this: using f1_t = void (int, int); using f2_t = bool (int, int); //... Register_f1(std::autofunc<f1_t>::fu...
[no replies]
cryptopp561 InvalidCiphertext
 
Hello, I am new with cryptopp,i try to encrypt and decrypt text from a file. I alway receive this error CryptoPP::InvalidCiphertext at memory location 0x001...
[no replies]
Can someone explain a for loop to me?
 
for (i=1,i<=num;i++) WHAT DOES THE i INDICATE? -thank you
[5 replies] Last: for (i=1,i<=num;i++) This doesn't work. A for-loop looks like this:... (by closed account j2NvC542)
by jajang
Hi I need some help with error C4430
 
I have to write a program that do Caesars Cipher. I have 3 file: main header and implementation file. // JangJHW3.cpp : main project file.=================...
[no replies]
Need some help with Class Average Calculator
 
I have to create a class average grade calculator for my C++ and having some major trouble. I am very new to programming and have been having trouble catching u...
[no replies]
Overloaded Arithmetic Operations on fractions
 
Hey, I'm 100% new to Overloading Operators, I don't fully get the syntax. The goal here is trying to divide fractions. Fractions are stored within a class. My...
[no replies]
comparing two data files
 
I'm trying to compare two data files character by character to see if they are the same. If the files are different, the program should print out the line numbe...
[1 reply] : You could store the current line number in a int variable. If you read... (by Peter87)
String reference
 
in a function { int i=0; string s=(char)i; } Doesnt work But, { int i=0; string s; s=(char)i; } seems to work. Why???
[1 reply] : string s=(char)i; This doesn't work because std::string doesn't have... (by Peter87)
How would I make this into a while loop?
 
#include <iostream> using namespace std; int main() { int num; cout << "Please enter an integer\n"; cin >> num; if (num ==0) ...
[4 replies] Last: Thanks Elidor:)!! (by closed account 4wRjE3v7)
While loop not working?
 
I have a while loop in my program, but it's not working properly. It will take a long time to finish a relatively short 'if' sequence. The strangest thing is, i...
[5 replies] Last: OK, I changed it so that it only uses acquire and releas screen twice,... (by racefreak)
pointers
 
why are the arithmetic operations like division(p/q) and multiplication(p*q) invalid on pointers?.here p and q both are pointers .
[6 replies] Last: @vlad from moscow And so I learn something new! Subtraction of two po... (by Thumper)
Does pubsetbuf() ever return nullptr?
 
[quote=cplusplus_com]streambuf* pubsetbuf ( char* s, streamsize n ); In case of success, the member function should return a pointer to the object (this pointe...
[1 reply] : C++11 ยง27.6.3.2.2 basic_streambuf<char_type,traits>* pubsetbuf(c... (by Peter87)
Isomers of alkanes
 
I want to make a program which finds the number of isomers of an alkane ,given the number of carbon atoms (mainly for those who know the basics of organic chemi...
[2 replies] Last: you also used "void main" and goto This is why: http://www.cplusplus... (by eklavya sharma 2)
cout is ambigious help pls
 
why suddenly my code is showing cout is ambiguous..help pls
[10 replies] Last: Okay, a few things. Firstly, you define a constructor twice (which sh... (by Thumper)
dynamic memory errors
 
/*Hi I am new to C++ language and I am still learning. It is difficult but I'm slowly getting there. I'm doing basic stuff to better understand dynamic memory...
[1 reply] : You're not creating any dynamic memory here. 'str' is always just a p... (by plexus)
February 2013 Pages: 1... 1920212223... 43
  Archived months: [jan2013] [mar2013]

This is an archived page. To post a new message, go to the current page.