Beginners - September 2014 (Page 21)

why functions in a class are defined outside the class using scope operator
 
Hi all, code below class A { int a; public: int func(int x); //why the definition is given outside the class } int A::func(int x) { a=10;...
[1 reply] : why are we defining outside the class. So we would not clutter the c... (by MiiNiPaa)
by RotciV
SIGSEGV Error, return value 3221225477
 
Hello, I am a beginning programmer and I am having a problem with my program. My program is suppose two create two matrices and multiply them together. I got th...
[4 replies] Last: What are you doing on line 5? (by keskiverto)
by Faurax
Compile resources in projects
 
Hi, this is probably a newbie question and I am not sure if this is the right forum for this. I have earlier made small graphical projects with C++ and SFML in...
[no replies]
Explain difference b/w the two codes
 
How does the compiler interpret the position of the initialization int f(1); in both the cases. //Finding the factorial #include <iostream> #include...
[3 replies] Last: Any initialization expression should be before while loop. (by Knightrider29)
reading a set of bits with a boolean operator, I think
 
For part of an assignment that I'm working on for class, I need to write a for() loop that will read a series of bits individually and assign values of true or ...
[2 replies] Last: To check if a bit is on you can use bitwise AND. unsigned char byte ... (by maeriden)
by Cadis
Tax deduction function
 
I'm trying to write a function for whether or not tax deductions are applied based on income and family size but I keep getting errors in my build. If income is...
[4 replies] Last: Thank you for all the replies! I'm still learning to use C++ so please... (by Cadis)
I keep getting an undeclared identifier error. (1,2)
 
Hey guys, I am trying to write a program for class and I keep getting an undeclared identifier error... #include <iostream> using namespace std; //d...
[30 replies] Last: I thought that was what your prof might be doing MJ. It's all good pra... (by closed account 48T7M4Gy)
by Sylnox
Understanding Exception Object Propagation
 
I just read about exceptions over on learncpp.com, and while I think I understand most of it, I have one lingering question that I can't find a clear answer to:...
[4 replies] Last: Whoops. I didn't see your edit at 8:52. To be honest, I do not know... (by JayhawkZombie)
basics
 
If you want the user to input an integer value into your program for a variable named number, what arc two lines of code you could write to ask the user to do i...
[18 replies] Last: Hmm. Alright. If you're on chapter 3, then you might be learning abo... (by JayhawkZombie)
what will be the program in C++ using FOR LOOP??
 
#include <iostream> using namespace std; int main() { int odd; int even; for(odd = 1; odd<=99; odd = odd + 2) cout<<"the odd number is ...
[6 replies] Last: If you want more help, you'll need to give us more information about w... (by JayhawkZombie)
by Kernul
Searching for sequence in a file
 
This is an exercise I found: With a file containing a very long sequence of numbers, write a program that, asking for the path of the file and a new sequence of...
[19 replies] Last: Oh right! Anyway, now it works! Thank you for your help! :D (by Kernul)
Using Stored Values
 
Hello. I'm a beginner to C++. I'm trying to make a simple program whereby the system asks the user a series of questions, whilst the user enters a "0" or a "1...
[1 reply] : You could always use a container to store these answers. I would proba... (by JayhawkZombie)
convert 2d character array to 2d integer array
 
simply what i want to know is if i can take a 2d array of characters and convert them to a 2d array of integers. My wanting to do this is to add a tile map t...
[1 reply] : That isn't a 25x25 array, that's a 5x5 array. You'd have to use a 2x f... (by Ganado)
how to use "friend"
 
Hello, I am having an issue with my program, but I don't know what I am doing wrong. #include <iostream> #include <cmath> using namespace std; class ...
[2 replies] Last: Oh I think I understand, you could only something similar to what I tr... (by heyyouyesyouiloveyou)
Error: Undefined Reference (1,2)
 
Alright, first off I am a beginner so try to go easy one me here. I am making practice programs and I have made 3 if them and I was proud of myself. Anyhow, ...
[21 replies] Last: loop it? (by TheBadCoder)
Unresolved External Symbol Error
 
I am writing a templated stack class for a programming class, and I cannot for the life of me get it to compile. My IDE is Visual Studio Professional 2013. ...
[15 replies] Last: Well, I've read not so many books, like: - Addison Wesley's C++ Templa... (by S G H)
by plp384
Using while loop, Help get the output to stay all on the same line
 
Based on the code I've written below, after debugging in vs 2010, It won't allow me to put the input of cin on the same line as the output before it. Any hel...
[3 replies] Last: I don't believe that is possible with just standard cin, when you pres... (by Ganado)
by bigbzt
Help with a While loop.
 
Hey guys, a bit of a C++ beginner here, just need some help figuring out where to add a while loop that will ask the user if they want to solve another equation...
[7 replies] Last: Thanks for all the help, got the normal while loop to work, had the en... (by bigbzt)
Help Fast!! Exam tommorow...
 
See the Problem in this program is the logic..... The Question is to display all even numbers in an array and count the no of even numbers..... The counting...
[4 replies] Last: cout<<"Thank you it works now ..."<<endl; cout<<"oh god 1 mistake in C... (by raheel1212)
malloc'd memory goes to NULL when control goes out of funtion's scope
 
I heard that malloc() allocates memory from the heap which doesn't go away until you free() the memory, but when I run this program, I get "Hello" for the initi...
[1 reply] : Line 19: HashTable doesn't exist. You mean HashTable , right? Al... (by Duthomhas)
September 2014 Pages: 1... 1920212223... 51
  Archived months: [aug2014] [oct2014]

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