General C++ Programming - December 2014 (Page 12)

by wyj216
Should I use vector or just double array?
 
I am programming about some numerical problems. I know that vector supplies vector operations. But vector always allocate more memory (used when the size change...
[6 replies] Last: > Somebody said that std::valarray is an unsuccessful class, and it's ... (by JLBorges)
by yevo
Error: expected unqualified-id before '.' token
 
Good evening. I am doing an assignment for my class. I am using codeblock. My assigment is to implement a circular queue. My code is below, as well the error. F...
[3 replies] Last: Thank you. Peter87 and minomic. (by yevo)
need help for string condition whit a while
 
the code is in french but that's not the problem , string PseudoOK; cout << "votre pseudonyme est: " << pseudo << ", confirmer? Y/N"<< endl;...
[4 replies] Last: cin may represent not only a keyboard but also a f.e. a disk file or... (by tcs)
Rotating Sentences
 
Write your question here. INPUT / OUTPUT As input to my program, I will be given a maximum of 15 sentences, each not exceeding 100 characters long. Legal char...
[4 replies] Last: Yes I know... I left that part to you and showed just how to print the... (by minomic)
by srango
c++ memory allocation question?
 
question : I guess, this question requires some kind of memory pool and it needs to be allocated a big chunk of memory at the beginning.. But again, what is t...
[5 replies] Last: in that case, what does the parameter "base" mean in create_range_all... (by cire)
Matrix allocation, initialisation and deallocation
 
This code throws "Access violation reading location 0xCCCCCCCC" exception. It occurs due to nullpointer at line "p =0.;". How could I handle the problem by cha...
[4 replies] Last: You haven't "solved it." You've only made it compile. The code is st... (by cire)
c++ function does not update a class' variables in recursive call
 
I'm trying to implement Tarjan's Strongly Connected Components Algorithm in C++. Here's how I gotten so far: void tarjan(vector<Vertex>& G){ index = 0; wh...
[1 reply] : http://www.eelis.net/iso-c++/testcase.xhtml (6. Make sure your testcas... (by ne555)
casting to rvalue
 
I keep reading std::move just casts things to rvalues. What I don't understand: How can you convert an lvalue into rvalue? ClassA obj; std::move(obj)...
[3 replies] Last: Expressions can be l-/r-/x-values, but cannot have a reference type Ob... (by Cubbi)
Having problem with maps/logic
 
So I am having this problem(mostly logic, slightly programing) I have am using a map to hold some information about my monsters/npcs in my game, but the prob...
[1 reply] : ended up fixing this by adding a vector to monsterClass to hold a list... (by kalisto2002)
Bipartite graph
 
Question ->http://www.spoj.com/problems/BUGLIFE/ In this question we are given number of bugs and their interactions we have to check that there should not be ...
[2 replies] Last: Thanks Cire . I got the problem. (by ankur12106037)
Help with making an automated response genreator
 
Basically I have made a code that generates only one response, I have collected around 100 responses from my friend, and the whole idea is to get a different re...
[11 replies] Last: What do you mean by "address this case"? Are you referring to gener... (by AbstractionAnon)
Help me with my coursework. PLEASE!
 
Hey there! I'll be really thankful if you help me with this task...I'm translating it from my language so there might be mistakes but I hope you're going to un...
[1 reply] : I would recommend using objects instead of structs. Structs are a bit ... (by Sh0es)
by Sh0es
Indefinite User Input Loop
 
In short, I'm trying to make a CLI for a project that can take multiple user inputs add I don't exactly know what I'm doing. I'm able to get cin to take one use...
[8 replies] Last: Oh I use proper IDEs. I was just using IDEone for unit testing and dev... (by Sh0es)
This pointer
 
How do i pass this pointer to an fstream read/write function? I have two possible formats f.read((char*)&this, sizeof(egclass)); f.read((char*)this, size(egc...
[1 reply] : #include <iostream> #include <type_traits> struct A { // ... ... (by JLBorges)
ofstream and fltk
 
How can I make a textile in a FLTK executable in main(), so when opening the program, and put text in it? The standard way via ofstream does not work now. The ...
[no replies]
Numbers question
 
Hi, I got a numeric question You get a streaming of 1's and 0's. You need to detect when the streaming satisfies the following sequence: 1. at least six 1's 2...
[7 replies] Last: > When the Window Size is Max, the Start and End Pointers will differ ... (by JLBorges)
by Sh0es
Object Destructor Throwing SIGSEGV
 
I have the following code. The destructor throws a segmentation fault when it gets called. My first instinct is that there's something screwy with the array all...
[19 replies] Last: On a side note... is there any reason you aren't just using vector? I... (by Sh0es)
design our own container
 
how can i write my own container which has properties of both vector and list. eg. i can access elements directly using operator like vector and behave lik...
[1 reply] : https://gcc.gnu.org/onlinedocs/gcc-4.6.3/libstdc++/api/a01115_source.h... (by poteto)
Size of struct program
 
Hello, I'm having trouble figuring out how to find the size of an array program that involves "struct." #include <iostream> using namespace std; struct...
[1 reply] : Use vectors if the array size is dynamic. If it's not dynamic, then ju... (by poteto)
integer array
 
Hi, I'm a beginner here. could you help me solve this assignment question. please I need the solution ASAP. thank you Given a 5x4 integer array, one element ...
[1 reply] : Hi, try to write two nested for loops (one for the rows and one for th... (by minomic)
December 2014 Pages: 1... 1011121314... 31
  Archived months: [nov2014] [jan2015]

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