General C++ Programming - December 2013 (Page 26)

by Vex5
Trouble with 2D input
 
Hey guys, here is the example input I want to read: 3 2 .. ## 3 ... ... ..# 4 .... .... #### #### And here is my code: #include <iostre...
[3 replies] Last: I solved it, it seems scanf has problems with 2D arrays so I used cin ... (by Vex5)
Error C2440 in visual studio.
 
Hello, Im updating some old code and cant find how to get around this error on compile. error C2440: 'initializing' : cannot convert from 'const char *' to '...
[2 replies] Last: Can you show the declaration of valid_letters? That cast seems exce... (by kbw)
array sort
 
#include <iostream> using namespace std; void main (){ int a ={3,8,0,10}; int k=8; int index ; for(int i=0;i<=3;i++) if (a ==k){ index=i; b...
[5 replies] Last: Ok. Pleasure helping. . . (by dncp4312)
"Error - Expected initializer before 'int'
 
I can't figure out what I'm missing or what I did wrong, but I'm new to this and not very good at all so if it's completely wrong, just tell me and I'll work on...
[3 replies] Last: You have double brackets in this part: int main() { { Simply remov... (by Aidan Gladwell)
Difference between const and static const
 
Hi, Please explain difference between const and static const, more effectively. If it is possible pls explain with example. Note: I know the basic concep...
[5 replies] Last: Thanks to all for giving valuable information. (by Ajaycpp)
Information on programming
 
Hello there! :D In the past two weeks I have been attempting to learn how to create something out of CMD prompt, in other words start programming actual progra...
[10 replies] Last: Yep haha, kind of like a apythony lol (by Jamie96)
An object returning part of itself
 
Is it valid for an object to return an object of they same type? Please look at the getBlock method class memBlock { private: char *mem; ...
[1 reply] : Is it valid for an object to return an object of they same type? By... (by cire)
by Zyl
class template constraints
 
Hello, how do I constraint a class template i.e. instead of // T could be anything template <typename T> class MipMap { ... }; do this // T must...
[8 replies] Last: ^ Good call. The ownership ambiguity was already annoying me while I w... (by Zyl)
Reading and editing a file bit by bit
 
Basically what I am looking for is a way to get a block memory, copy it into ram in a format along the line of bit[#], replace the original with a new code that...
[3 replies] Last: > if I opened even a 100Kb file in that it would be close a GB of ram... (by JLBorges)
How is my first bit of code?.. *GASP*
 
Good Afternoon Everyone, I would like to start by saying hello to everyone out there. I am a college student, father of 2, and have just put together my firs...
[3 replies] Last: I am ultimately looking to find if I should be doing something differ... (by Cubbi)
Default Constructor help
 
For my default constructor I need to set an array of strings to null and the size variable to 0. Here is my code for that DynamicStringArray::DynamicStringA...
[1 reply] : You write only for the declaration, else it thinks you want the valu... (by Zyl)
by vcj2d
Stacks, Queues, Templates, & Vectors
 
My Lab assignment just corrupted and I hadn't finished debugging my errors. I last worked on it two days ago. I can't remember what I had after a week of debug...
[3 replies] Last: Okay so I have figured out that i need to use two variables for part A... (by vcj2d)
by Del125
Array Inputs
 
I want the code to get information along a certain row of a text file using an inputted value that is the same the first value on the first column. The text fi...
[no replies]
Help with code for floating point numbers
 
I am stuck on this question Produce a program which requests the inputs of ten floating point numbers between zero and one hundred and stores these numbers in...
[4 replies] Last: My next problem is I have to find the largest, smallest and the averag... (by theKarateKid)
by D14
Can anybody help?!
 
Hi, can anybody help me with this program? I have to make a Christmas tree. Below is my current program but I think there may be a few errors and I don't know w...
[5 replies] Last: @theKarateKid make your own thread (by Chriscpp)
by gatar
struct pointer SEG fault
 
#ifndef _COMPILER_H_ #define _COMPILER_H_ /* * compiler.h * */ #define TRUE 1 #define FALSE 0 #define NOOPSTMT 100 #define PRINTSTMT 101 #define ASSIG...
[no replies]
word frequency in a text
 
This program counts how many times does a word appear in a text. Can someone please explain why i have to add 1 to p in the while loop? Thank you! #...
[1 reply] : Can someone please explain why i have to add 1 to p in the while loop... (by cire)
input file
 
#include <fstream> #include<iostream> #include <iomanip> #include <stdlib.h> #include <conio.h> using namespace std; #define size 3 void main() ...
[1 reply] : The input file can be read,but it will be read twice. can anyone help ... (by Chin Pei Ying)
Need help with adding matrices
 
Hey guys, new here and wanted someone to help me figure out this program I have to do. I keep getting a error where I have defined ReadDouble and ReadInput, sa...
[5 replies] Last: Can you show me how to change the AddMatrix of my program to multiply ... (by pintu1228)
c++ code nead -help
 
c++ code help input day: second month :february output : 33 day of year
[no replies]
December 2013 Pages: 1... 2425262728... 37
  Archived months: [nov2013] [jan2014]

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