General C++ Programming - July 2013 (Page 8)

by nkhau
Got some errors.Need help here.
 
#include<string.h> #include<stdio.h> void main() { int i=0; char choice; int count=0; int row,seat,rw,r,s,x,se; int waitinglist=0; char name ; char smoke; char...
[8 replies] Last: You don't know how do indent? You tab/space your code so it's easier t... (by closed account N36fSL3A)
I need help
 
So I programmed this big application in Win32, I left the cursor the same, but I want to give the user the option to use some pre-made cursors, or upoad there o...
[6 replies] Last: i think, Anyone do it... (by Tracyise)
random_shuffle question
 
Hi there, I'm looking to have the list of words in the vector shuffled randomly each time at the start of the program. However, they shuffle in the same order e...
[7 replies] Last: I got it to work using shuffle() . However, it's using some syntax th... (by Indikator)
Vector issue / Classes
 
I am having a weird issue with vectors. I can put items into the vector. But when I got to look inside the vector it's empty. See code below. Sean int ...
[8 replies] Last: I fixed this issue. I just re-wrote the entire program from scratch. ... (by fuzzylr)
Exporting to Excel
 
I'm trying to import table from a txt, isolate and change some of the data (ex: utc to gps time), and export that new data into excel, probably as a csv. The te...
[1 reply] : Open MyExcelFile in append mode - http://www.cplusplus.com/reference/f... (by norm b)
by RLC
can't enter phrases in loop
 
getline is not readable after first time through loop. It skips that line and goes to Do you want stop entry? line. I would appreciate any help that I can ge...
[9 replies] Last: Hi Andy, I modified the program again and it now works. The placeme... (by RLC)
Good Physics Book?
 
Most games have some form of physics. I'm taking a class when we get back in school but I'm impatient, does anyone know some good physics books that seem to go...
[7 replies] Last: I've gotten the book digitally, thanks it's not bad. It certainly assu... (by Austin J)
VGA Sequencer register 4 Odd/Even?
 
When I look at DOSBox's text modes, it sets VGA's Sequencer Memory Mode Register bit 4 to 1 to enable the Odd/Even modes, but when I look at the VGA docs ( http...
[no replies]
Help with nested While!
 
The code only executes the nested while once.. why?? int main() { int base, expo, power; while (base!=0 && expo!=0) { count = 0; cout<<"Enter...
[5 replies] Last: Tnx Guys, got my code to work.. *I was told to do this exercise using... (by renzboi21)
Urgent Question about data types
 
Hi guys, I'm new to the forum and I have the 2 following questions regarding data types. I'm torn between choosing A and B for #1, and torn between choose A...
[3 replies] Last: @AmyWalker #1 what if int is 16 bit on the platform? wouldn't that ... (by vlad from moscow)
how to do Precision with ostrstream
 
Hi all can you help me in setting precision for the float value for eg.. ostrstream out; float fvalue = 2.7889 out << fvalue; if I take the valu...
[3 replies] Last: thanks you andy and ats15 (by kulkarnisr)
by nkhau
How to run this while loop?
 
char choice; while (choice !='E') { printf("(A)"); printf("(B)"); printf("(C)"); printf("(D)"); printf("(E) Quit"); printf("ENTER CHOICE : "); scanf("%...
[1 reply] : I done see much of a code problem, a tip to go to the next line to mak... (by Tertius Kgatla)
Input number as string in an array.
 
Hello. I need to ask the user to input a number, and then put the number in a string array. so for example if the size of the number was 4: example 1200 i woul...
[5 replies] Last: by array here you mean character array right? (by c0defisher)
by vRltwE
How to change the cell text color in a QTableView?
 
I've tried this (without success): ui->tableView->model()->setData(ui->tableView->model()->index(5, 5, QModelIndex()), QVariant(QColor(Qt::red)), Qt::Deco...
[6 replies] Last: try this: QVariant MyTableModel::data(const QModelIndex &index, int ro... (by norm b)
by edfed
delete pointers from vector
 
i have something like this: class A { }; class B : public A { }; class C : public A { }; B*b1; B*b2; C*c1; C*c2; vector<A*>vec; int main() { vec.push...
[7 replies] Last: For what it's worth... if you use smart pointers, you'll never have th... (by Disch)
how this output displayed??
 
#include<iostream.h> #include<conio.h> void main() { int x ={1,2,3,4,5}, y ={5,4,3,2,1}, result ={0,0,0,0,0}; int i=0; while(i++<5) result =x -y ; clrsc...
[17 replies] Last: this program writes into memory past the end of the array result , in... (by BranL)
Integer sizes with cstdint...
 
I am currently working on a Windows and Linux program that will share configuration files. It will be compiled as both x86 and x64 on both platforms. With that ...
[5 replies] Last: Can you explain to me why my fwrite example is wrong? I will look up s... (by Sephiroth)
how to pass object to a class which stores it in a container as unique_pointer
 
class A (abstract) class B : A class C { void add ( A(&*?) a ) std::vector<std::unique_ptr<A>> data; //unique_ptr<A> because A is abstract and therefo...
[10 replies] Last: A wee bit more robust: void add( T*&& p ) { seq.emplace_back(p) ; p =... (by JLBorges)
Operator overloading,comparing objects
 
i'm trying to compare 2 fractions using operator overloading the program crashes when this is called; this is defination; bool operator == (const Fractio...
[7 replies] Last: ahan thanks (by haroonRasheed)
syntax question
 
Hello, Line 1 passes &C::increase_member to the thread constructor in the below code. I do not understand what &C means here. Can someone please explain? tha...
[3 replies] Last: No, that would be a different expression with different meaning (to be... (by Cubbi)
July 2013 Pages: 1... 678910... 34
  Archived months: [jun2013] [aug2013]

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