General C++ Programming - August 2016 (Page 10)

using || in do-while loop
 
I have this program here, it isn't complete, just starting it off. It's a switch sequence within a do while loop. If the user input is Q or q the program should...
[3 replies] Last: Here, given the way you are using the switch statement, you could do t... (by andywestken)
this program isn't working and i don't know why?
 
#include <cstdio> int main(){ int s=12; int c=0; int l=1; freopen("hallin.txt","r",stdin); freopen("hallout.txt","w",stdout); scanf("%d",&s); whi...
[2 replies] Last: Line 10, s-l; , is not doing anything. (by closed account z05DSL3A)
how can i read a gif file byte a byte?
 
heres what i know about the gif files: 1 - the 0x2C(',') is the Image Separator; 2 - the 0X3B(';') is the Image Terminator and the Trailler. knowing that, i ...
[1 reply] : Make sure you opened the file in binary mode. (by Peter87)
I need some assist here , my C++ code is not working
 
My code is as below , I cannot display anything out , I spent a whole day on checking the mistakes , but I can't found any . I'm looking for some help here , th...
[4 replies] Last: I found out what's the problem already , thanks guys (by badbuddy1)
hello, I have a question about ctime library
 
I want to get the time difference between certain moments of objects life but it seems that variables in them stay unchanged! // variables time_t start; time_t...
[4 replies] Last: thank you very much!!! (by davidgoder)
Best Graphical Library To Develop a Weather Simulation Map?
 
I want to recreate a weather map that you see on most weather channels. I don't need real time Doppler radar data, I would use a fake data set to populate the U...
[no replies]
Why pass by ref when you can pass by memory location?
 
Hi All, I have been playing around a little with the C++ references, and I wonder - why would you use a reference over just passing the variable's memory locat...
[4 replies] Last: Thanks Ganado, So you would use this in the case of objects (rather ... (by nzsteve)
enums nested in a class
 
// forward declaration, doesn't work // enum Cage::Bird; class Cage { Cage::Bird f_bird; public: Cage( Cage::Bird bird) : f_bird(bird) {} en...
[2 replies] Last: Thank you, Thomas! (by nuderobmonkey)
by well
less<TYPE>
 
template <typename T,typename F=less<T>> int compare(const T &v1,const T &v2,F f=F()) { } I can't understand "F f=F()",because the return_type of less<T...
[1 reply] : F() - an anonymous temporary object of type F (which is value ini... (by JLBorges)
Rotate the Matrix
 
I'm trying to rotate a matrix inplace (clockwise direction). Below is my code, everything seems right but I'm getting runtime error. Can anybody explain to me w...
[2 replies] Last: @AbstractionAnon I get it thanks. Silly mistake (by atinesh229)
Unreal Engine Compiling Errors
 
I'm having trouble finding the problem compiling this in Unreal Engine 4 4.12. Can you tell me the problem of this? MyActor.cpp // Fill out your copyrigh...
[no replies]
Forgot a few of my basics
 
Ok, I did cote code in c/c++ for about 6 or 7 months. Can you tell and explain the output of this code. int main() { int a=5; cout<<a++<<" "<<++a<<" "<<a+...
[9 replies] Last: That's crazy! Why is it so unorderly? What happened to order of opera... (by closed account E0p9LyTq)
by Bo Hu
read in .csv data and array manipulation
 
Hello, I tried to read a 3001 x 90 .csv data file into a two dimension array and then divide the array into three 3001 x 30 arrays. Then I tried to build a loo...
[5 replies] Last: I tried to fix it as possible as I can, but I got lost again.... #i... (by Bo Hu)
need help with pizza c++ programm
 
Hi everybody ! i am a begginer c++ programmer and im trying to make a basic pizza programm that takes the users order and then outputs the result. however at ...
[3 replies] Last: for (int i=0; i<c; i++) { total += prices[order ] * quanti... (by AbstractionAnon)
Unexpected side effects of using inside a namespace
 
Hi, I just came across the most unexpected situation and I want to share it with all of you just in case you haven't faced it yet. I have the following code: ...
[3 replies] Last: Yes I had included chrono. Yes JLBorges, you provide the rationale: X... (by JUAN DENT)
sorting algorithms process output! NEED HELP!
 
CAN ANYONE HELP ME CONVERT THIS CODE TO OUTPUT THE PROCESS OF INSERTION AND SELECTION SORT. SO THAT I CAN COMPARE OR STUDY THE CODES. int num, arr , i, j,k,...
[1 reply] : Do you mean like this? Enter no of elements :5 Enter array element... (by Thomas1965)
BIG O time calculation question
 
According to this book on discrete math, if O(x^2) is the complexity, and it takes 3 seconds to run the algorithm when x = 100, then it takes 9 seconds when x =...
[3 replies] Last: The question is bogus in 2 important ways. First, Big-O is an uppe... (by htirwin)
member access operators
 
Hi, If I create an instance of obj (Wood obj) I can only access its members/vars with (.) -- cannot use (->) member access operator in this case. Conversely if...
[3 replies] Last: Some lamo attempts to replicate the "non-syntactic" a->b == (a*).b (by technologist)
by Bo Hu
Issues with stack overflow and access violation reading location
 
Hello, everybody, I am totally a beginner in C++. I tried to write some codes for my study, but, by the results of debugging, encountered issues with stack ove...
[1 reply] : LIne 302 creates a very big array on the stack. The stack is usually r... (by dhayden)
A program to check gift card balances?
 
So I work for a company who gifts people with different type of gift cards l, depending what the customer choses after the purchase. Now my duty is to check if ...
[6 replies] Last: Sounds like a straight forward process. You need to read the gift card... (by Thomas1965)
August 2016 Pages: 1... 89101112
  Archived months: [jul2016] [sep2016]

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