Beginners - March 2015 (Page 3)

Another pointer exercise
 
Hi, i was doing another exercise from my book and it all works but it feels like there must be a better way to do these 2 things : 1. Making this duplicate ...
[4 replies] Last: Thanks for answer :) (by etrusks)
How to define 2 values for 1 variable.
 
For example, I want to define product_code with 2 different values: product_name and product_price?
[2 replies] Last: Easiest way is to use a struct. struct product{ string name... (by It3rat0r)
Printing value of EOF
 
Can someone create me a small program to print the value of EOF (end of file). I am doing the following. what's wrong here? also in Xcode the program run does ...
[4 replies] Last: printf("%d ... (by Duthomhas)
Problem with for / while & nested loops
 
Hi all, I'm very new at programming, still at introductory level. I'm trying to work out this problem, but I'm not sure what I'm doing wrong. Any assistance wil...
[5 replies] Last: I just tested it and grossSalary works as intended, it does the calcul... (by TarikNeaj)
by XscegX
New to C++, help please!
 
Write your question here. I having a problem with converting centimeters to yards, feet and inches. I can get the first test variable(312cm) to come close to...
[3 replies] Last: So I havent tried it yet but the more I look at your example, wouldn't... (by XscegX)
allocating memory for char array in free store
 
Why I'm unable to create this array the 2nd way? How could it be done without at 1st creating this array ( char arr = "Hello"; ) and only than creating pointer...
[no replies]
Calling functions from other classes
 
How do I call functions from other classes from inside another class? I have an assignment to make this sort of thing but I was sick on the day we learned it. I...
[3 replies] Last: If you want to group related global functions, use a namespace . By ... (by LB)
by koopey
beginner in recursion
 
Hi guys. I have this problem where I have to search for a value in the array and return the index of the array if the value is found. if value isn't found, it s...
[10 replies] Last: woooooohhh. that was highly explanatory. got it. thanks :D (by koopey)
Using nested loops to print a number square
 
I've been trying to figure this out for a long time. I have to read in a number from the user, NR, and repeat the outer loop NR times, and use the inner loop to...
[3 replies] Last: sorry.... just remove the <= and replace it with < and it will wor... (by shadder)
by Ganado
const reference of map - operator[]
 
This code gives me a huge template-mess error: struct Node { std::unordered_map <std::size_t, std::size_t> map; }; void test(const Node& node) { std:...
[3 replies] Last: You can use map.at() http://www.cplusplus.com/reference/unordered_... (by norm b)
Finding Perfect Numbers and outputting their divisors
 
So, I have a project for a class, where I have to take the input of several numbers and check if they are prime, or perfect. I've been able to get the program t...
[6 replies] Last: Actually finally figured out the logic behind it. if num1 divided by ... (by ArmaSwiss)
Help with arrays
 
Here is my code so far #include <iostream> #include <fstream> #include <string> using namespace std; int main() { string names , fileName; d...
[no replies]
best compiler for beginners
 
what is the best free compiler and other software to use for just getting started in teaching myself C++ ?
[1 reply] : If you are on Windows, get Microsoft's Express compiler. If you are o... (by Duthomhas)
overloading [] operator
 
Hi, im having trouble overloading the operator. Heres what im trying to test: void test() { cout << "3. Array declared with two integers: IntArray c(6, 8)...
[10 replies] Last: Well of course... using a vector kind of defeats the point of writing ... (by Disch)
connect mysql database to eclipse c++
 
does anybody can help me to do this? i want to connect mysql database to eclipse c++ but it dont works, i receive an error which say: SOCKET doesn't name a typ...
[1 reply] : You'll probably find some answers if you google it. (by TarikNeaj)
PLEASE HELP Parsing
 
I'm not sure how to start on this, I am a beginner and our teacher didn't do a good job of explaining and I cant find any good examples Write pseudocode that...
[no replies]
by iMarsC
Version of C++
 
Hallo, new here. I'm an experienced user of Turbo Pascal 7. ( robot/machines: lot of math like Forward/Backward Kinematics, and 3D. Also have been...
[6 replies] Last: Thanks you all! Gonna try it the coming days! I'll report my progres... (by iMarsC)
by oseri
Memory pools and automatic variables
 
I've made a linked list implementation based on a memory pool. But as I came to analyze the code, I got a strong feeling that it might leak and would need someo...
[no replies]
quadratic question
 
write in c++ a statement that evaluates one of the roots of the quadratic equation i dont know how to start, i am doing the review test, and i am stuck here,...
[5 replies] Last: Also, be aware of rounding. Unless you have a pleasant numbers for a, ... (by Ganado)
How to write a funtion parameter list with pointer?
 
As you can see, if the parameter list is a int, there won't be any problem, but when it is an object pointer, then here comes the problem. Why? void setClose...
[1 reply] : Any body any idea? (by northfly)
March 2015 Pages: 12345... 51
  Archived months: [feb2015] [apr2015]

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