Beginners - March 2016 (Page 20)

sizeof (char)*
 
Hi Please consider the following expressions: int bufsize1; int bufsize2 = 80; cout << sizeof (char)* bufsize1 << endl; cout << sizeof (char)* ...
[4 replies] Last: sizeof is resolved at compile time (i.e. sizeof (char) is replaced by... (by helios)
Help with counter and power
 
Write a program that first asks a maximum value and validate it. Then in a while loop, it calculates and prints sum of all even integers to the power of 6, fro...
[2 replies] Last: Luciab5, Were you able to figure something out for this? (by DirtyDan)
Operator << Overloading,why have to use reference
 
//This is a question I encountered while solving the challenge on hankerrank.com //Here is the original question :https://www.hackerrank.com/challenges/overload...
[2 replies] Last: Why is the Complex & z argument non-const in your output operator? S... (by keskiverto)
by Oboher
Modifing pointers in a function
 
I have a function to order some constant char arrays. I did this to order an array of numbers and it worked fine, but with this i can not find the way to make ...
[3 replies] Last: You can do that, but is it somehow better? When you call order ant ta... (by keskiverto)
Newton-Rapson Method
 
I have an assignment that I need to write for my C++ class and I just am not getting it. I have read my teachers powerpoint and I have looked for examples and ...
[3 replies] Last: I don't think so. Write the solver. Then call it twice. First with ... (by keskiverto)
this is not standard compliant right?
 
vc14 allows this, and it works fine in debug and release: #include <string> #include <iostream> struct what { std::string s; }; _declspec(noinline) void...
[2 replies] Last: thanks, thought so. can see why they allow it though as type is exact... (by elohssa)
by enesdl
Array Swapping Game Help
 
Hi I have some programming homework and I've got the main idea but I am not sure how to swap the numbers in the array. This was the question. This game has ...
[2 replies] Last: This was my old code I posted the wrong one can you please check out m... (by enesdl)
What is wrong in this program
 
I am getting this error "no matching function for call to 'make_pair(char&, int)'" when I am trying to insert into hash map(using make_pair) as shown in the bel...
[2 replies] Last: The raison d'être for std::make_pair is to let it deduce the target... (by JLBorges)
how to calculate checksum for particular array?
 
hello...i want to calculate checksum for below given array....this is 24 byte array and last two byte for checksum==> unsigned char ReadTemplate = {0x55,0x...
[no replies]
by asya
How to print a line for Hare Tortoise race
 
I have the program for the simulation of the race between Hare and Tortoise. The tortoise and the hare move randomly until they reach position 70. It works fine...
[no replies]
Trouble with defined function (error c2660)
 
I am trying to make a fraction calculator but keep getting error c2660. I am not sure if it is a logic problem or my function is not well defined. I tried googl...
[1 reply] : Hi, Just as the compiler says, you call the function on line 33 with ... (by TheIdeasMan)
by Arkin
Multiple cout statements
 
Hi, I'm trying to write a code and at first I thought it would be incredibly easy but for some reason it's giving me trouble. I'm fairy new to C++ and learning...
[2 replies] Last: Thank you!!! (by Arkin)
Multiple Consecutive Operators and Operands
 
I have an assignment in which I need to pseudocode as it's an intro course. So far this is what I have, but I don't know how I am to write it so it would allow ...
[no replies]
Making a table of converting Miles to Kilometers, completely lost
 
2. Write a program that: (Use logical operators || && to combine two condition checks in one if statement)  Asks the user to enter an integer that is great...
[1 reply] : Let's see what code you've written so far. Knowledge in the following... (by xismn)
c++ Armostrong Numbers
 
Hey guys. Can you help me to create a program Armstrong Numbers. I need to make a function named ArmstrongNumbers with two integer parameters(p and q), and the ...
[1 reply] : a function named ArmstrongNumbers Ok: ArmstrongNumbers with two... (by keskiverto)
by daym
OpenGL problem
 
Hi guys, I'm using OpenGL to create graphics and all that I'm facing a problem with this function glGenBuffers(1, &_vboID); I get build errors when I inclu...
[1 reply] : Definitely a linker error due to missing library. http://stackoverflo... (by keskiverto)
compound while statement conditions
 
Hello, I'm trying to write my first while code that will only spit out numbers when the "total" is positive up to a certain rage. I'm having a problem with m...
[1 reply] : The 'total' is uninitialized. What if the loop condition is false from... (by keskiverto)
by enesdl
Crossword Help
 
Hi I have some programming homework and I've got the main idea but i cant seem to get the strings to print out properly. This was the question. You are to w...
[2 replies] Last: THANK YOU SO MUCH! (by enesdl)
constexpr/const
 
I am learning about constant types constexpr and const. I am trying to differentiate the uses for these in a practical sense. Can someone give me a simple examp...
[1 reply] : Not so simple: http://en.cppreference.com/w/cpp/language/constexpr htt... (by keskiverto)
Quiz
 
I am trying to make a quiz using functions, but for some reason even if the answer is correct, i get an incorrect message. Does someone see where the mistake in...
[2 replies] Last: Line 7-8: You're reading from cin twice. Line 7 reads the answer int... (by AbstractionAnon)
March 2016 Pages: 1... 1819202122... 47
  Archived months: [feb2016] [apr2016]

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