Beginners - March 2014 (Page 71)

by Alby94
Template
 
i don't understand this piece of code.. template <class T> class Base : A<T>
[7 replies] Last: Templates and inheritance are unrelated. It just so happens that the e... (by LB)
Passing arrays to function
 
Hello everyone, I am trying to create an array of 200 random numbers and find the max value within specified upper and lower limits using a programmer defined f...
[3 replies] Last: You've defined the function to take an array as its first argument. W... (by MikeyBoy)
problem with sorting arrays
 
If somebody could help me with this logic: here what I'm trying to do I have 2 Arrays: matrice1 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 0 0 1 0 0 1 1 ...
[10 replies] Last: Strange. #include <iostream> #include <iomanip> #include <algorithm> ... (by keskiverto)
Trouble using setprecision and while loop.
 
I'm using setprecision inside the while loop and I just want it to be used on that same statement and not throughout the whole code but I'm not sure how. In cas...
[2 replies] Last: I got the same result. (by nothingkwt)
multiple if statements HELP
 
Hi there I'm doing a course in programming and im having issues with my work. The issue im having is that when i type in 2 into the console it seems to add the...
[3 replies] Last: if (1>=1){ cout << x+y; } if(2>=1){ cout << x-y; } These if conditi... (by wildblue)
need to read data from file through cmd line arguments argc and argv
 
I have a file named config.txt which has following data //config.txt Number of node = 11 Link delay = 1 2 3 4 5 6 7 8 9 10 now I want to read config.txt...
[1 reply] : Original thread: http://www.cplusplus.com/forum/unices/125112/ (by keskiverto)
memError occuring when using push_back method of vector
 
I'm actually using a SimpleVector template from a book (I modified it to include a push_back method). I have a SimpleVector of transaction arrays as a member of...
[4 replies] Last: Ok thanks, I didn't think to check the push_back method. I guess I was... (by theperson)
Question help!
 
1. Find the Value of X. a = 12; b=4; c=2; d=10; e=3; x = (a + d % e + e)/b % 3; 2. Write a c++ statement equivalent to the following mathematical assi...
[1 reply] : 1. If all variables are integer type then , value of X become 1. 2. ... (by ak16)
Trying to get transpose matrix, not sure what's wrong with my code!
 
I'm trying to print the transposed matrix of the input matrix, but my output keeps coming out to be: 4 5 6 4 5 6 4 5 6 when I input: 1 2 3 4 5 6 7 ...
[3 replies] Last: Perhaps a good reason not to use similar looking chars like i and j... (by TheIdeasMan)
Object Reference
 
So I'm doing an exercise for passing pointers. There is a bit of the example code that doesn't make sense to me. On line 27 SimpleCat* FunctionTwo(SimpleCat...
[1 reply] : 1. line:27 SimpleCat* FunctionTwo(SimpleCat *theCat); } I dont und... (by ak16)
cant fix this error after i compiled
 
i compiled this code but cant fix these errors. ( 1170_6_9a.cc: In function 'int main()': 1170_6_9a.cc:48: error: 'dry' was not declared in this scope 1170_6_9a...
[2 replies] Last: Thank you. (by nerdyboy11)
So close to getting the right output! For loops?
 
My goal is to take in an input height of h in [1,7] and output a diagonal matrix of 1's with the height h in a 7x7 matrix of zeros. e.g. For h = 5, the o...
[2 replies] Last: Haha, oh my. I feel silly. Thank you so much! :D (by ECEsasha)
c++
 
i have to to do this but im clueless A. Write a program that will interview 10 persons who wants to join the kluklux clan. • The program will ask three quest...
[1 reply] : this will help you, If any issue then please let us know. if(sex=="... (by ak16)
ASCII character converter
 
I made an ASCII character converter. You can input an int and it gives you the character with the same value or opposite. #include<limits> #include<iostr...
[3 replies] Last: it goes to an infinite loop. Why? The reason is that after entering i... (by coder777)
This homework assignment is due in 2 hours and I'm screwed. PLEASE HELP
 
I'm working on code for a class i am currently taking. The assignment asks to "write a C++ program that reads in an unknown number of test scores from the con...
[2 replies] Last: like above you also can write code for "median". try it by yourself. I... (by ak16)
by BaneX
formatting issue!!!
 
I'm having trouble formatting my code correctly. When i debug, the formatting is off. How can i fix it? This is how the output supposed to look like: Em...
[4 replies] Last: @Yanson, thank you. Although for some reason i'm not able to separat... (by BaneX)
Rectangular To Polar Coordinate Conversion
 
Hi guys, a little problem here. When a try to compile this program, I end up with the error: "prog.cpp: In function ‘void displayresult(double, double)’: ...
[3 replies] Last: Never mind, I figured it out by myself. Thanks keskiverto! Honestly, I... (by Kroggor)
by dnulho
using constants and statics to create ID's for object.
 
I am trying to create a unique ID for each object that is created within the program that I can refer to. class character { public: character() ...
[3 replies] Last: Since your class has const data members, you can't use the default ope... (by firedraco)
Using Scope operator and finding meaning in errors (1,2)
 
Ok so my question is when dividing up a program into header files and source files, as our teacher refers to as "Modules" I am running into a little confusion o...
[20 replies] Last: I had no idea that was meant to be used that way. I thought you were j... (by sparky1337)
Compiler Errors
 
I'm getting a compiler error that says: type qualifiers ignored on function return type. getting that error twice. any suggestions? thank you1 #...
[3 replies] Last: there are no const non-class rvalues in C++, so a function returning a... (by Cubbi)
March 2014 Pages: 1... 6970717273... 79
  Archived months: [feb2014] [apr2014]

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