Beginners - January 2016 (Page 13)

Can any data type be used inside an if statement?
 
I'm a grader and a little confused. One of my students placed an ifstream object in their if statement. ifstream reader(filename, ifstream::in); if (read...
[1 reply] : Yes, this is valid because all C++ streams implement operator bool() ... (by LB)
Cin command and pointers
 
Pretty simple question but it troubles me: So I have this code below in where 'char Example ' can contain 10 characters. But if I use cin command and pointer t...
[6 replies] Last: Thanks Cire. That made it pretty much clear. Edit: 20.1.2016: I add ... (by FitzUljas)
Need help with programming
 
Hi guys, I have been learning to program for a while, mainly in C++. However, I keep hitting this wall I have no idea how to get through. Since I did not know...
[4 replies] Last: Well I'd be happy to help you. Whenever you need my assistance then co... (by Stalker)
best way to create a dynamic 2d array to store image data
 
I have a struct containing 3 bytes, one for each pixel, a 2D array of these is to be written into a bitmap file generated the program. The size of this array is...
[3 replies] Last: It might be useful to think of the pixel data as a contiguous block of... (by Chervil)
Loop Timing Changes Considerably
 
Trying to teach myself C/ANSI C. I have been playing with the code below. The first iteration using the limit values of -1000 and +1000, the program takes abou...
[3 replies] Last: Thank you SamuelAdams and jlb for your replies. jlb: I plan to for ... (by randtekk)
How to make one class recognize a class object (located beneath it)
 
So I have this; class Item { ... } class Inventory { ... } class Produce : public Item { ... } class Book : public Item { .....
[5 replies] Last: I assumed that wouldn't work. I'm curious - what made you think it ... (by MikeyBoy)
Two layers of if else statement not working !
 
When I input 11 and 12 ,it always prompts equal!!!! What's wrong with my code ? #include <iostream> #include <string> // say what standard-library na...
[3 replies] Last: Hi, No, don't do that - it might be helpful to someone else :+) Am p... (by TheIdeasMan)
by abc1
void data type
 
I have a confusion void is one of the fundamental data type. But it does not take any variable,then Why it is called as a datatype? Please clarify my ...
[3 replies] Last: I would argue that hasn't created a void object, but has created a poi... (by Moschops)
by Zarman
Don't know why it isn't working.
 
#include <iostream> #include <string> #include <cctype> using namespace std; double average = 0.0; int a = 0; int main() { int i = 0; double donation ...
[1 reply] : Once you get to the second for loop: for (int x = 0; x < 10; x++){ ... (by guatemala007)
IS project Euler a good starting point to help learn and solidify more complicated programming and design techniques?
 
Write your question here. so, often times even though I have a moderate understanding of a lot of stuff, and some history and experience coding, I can't complet...
[4 replies] Last: I have started going through and solving for the project euler proble... (by jlb)
by Zarman
Simple C++ program having funky output
 
Why does the code I made have a funky number output? It just converts lower case to upper case and vice versa. It also echos the words you typed in, and leaves ...
[6 replies] Last: That was my first time using the <cctype> functions. I'll make sure t... (by jlb)
Finding Average from text file.
 
Hi! Say I have a text file, like this: Joe 15 Joe 16 Joe 15 Bob 12 Bob 13 Bob 13 and so on, in alphabetical order, with each student achieving ...
[3 replies] Last: yup I didn't read it carefully. sorry (by Zarman)
by jacobi
Live audio peak detection from a microphone
 
Hi, I'm a new programmer and I'm looking for some help. Here is my problem. I need to detect peaks in a live audio from a pickup microphone and output th...
[1 reply] : I assume you mean MICROseconds, not NANOseconds, but neither is possib... (by cnoeval)
problems with headers - part 2
 
I had one unsuccessful thread already about this in here http://www.cplusplus.com/forum/beginner/182848/ I will try to explain this lot more clear this time an...
[5 replies] Last: Tnx for your replies first of all :D string was chosen only for simpl... (by etrusks)
Creating a varying number of class objects
 
Hi! I've been wondering what the simplest way of creating a varying number of objects of a (of the same) class could be. For example, suppose I ask the user...
[4 replies] Last: Thanks for the replies. I know that the cost I posted is fishy, should... (by Sankarea)
by alitt
% meaning
 
what does it mean %d? scanf("%d",&num ); im gonna write this with cin>>&num ; but it doesnt work
[5 replies] Last: thanks got it (by alitt)
Can an Image show up?
 
Can we make an image show up on screen using C++ code?
[2 replies] Last: Can we make an image show up on screen using C++ code? Short answer:... (by closed account E0p9LyTq)
Read from CSV file in C++
 
Hi everyone, I am beginner to C++ and I have encountered a little problem. I have saved 5 numbers in a CSV file. Now I want to read these numbers from the file...
[8 replies] Last: I didn't know how to skip the comma and didn't have the time to do p... (by jlb)
Help with FFT
 
Hello everybody, I'm new to C++ programming but i have a project for school where you can help me with some tips. The basic idea of the project is to genera...
[3 replies] Last: My problem is how can I copy my vector with al the sample values to t... (by helios)
Coding an ATM
 
I need help, like, my teacher wanted us to code a simple ATM, and he wanted us to somehow make the pincode that the user enters to come out as * but I don't kno...
[9 replies] Last: Thanks for all you guys' help. (by DarkEnigma)
January 2016 Pages: 1... 1112131415... 29
  Archived months: [dec2015] [feb2016]

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