General C++ Programming - January 2014 (Page 8)

if statement error
 
i wrote this program to display even number from 100-200. But visual c gives me this error with undeling the "a" in if statement. Error 1 error C2106: '=' : l...
[1 reply] : Line 9 must be: if(a % 2 == 0) and main() must return an integer: in... (by condor)
Doing something weird with projectile motion calculator?
 
Some of you probably saw my question projectile motion formula in lounge. I'm trying to implement two formulas, however I'm having an issue. When I input an...
[1 reply] : I assume your angle is in standard position (no rotation is pointing d... (by Zhuge)
C++
 
Write a program that reads in ten whole numbers and that output the sum of all the numbers greater than zero, the sum of all the numbers less than zero (which w...
[5 replies] Last: It's inside of your loop anything inside the loop will loop each time.... (by giblit)
Reading file, then writing to it if duplicate not found
 
I'm having issues with writing to a file. more precisely, i'm trying to determine if a set of numbers are in the file. if they are already in it, don't write to...
[9 replies] Last: Thanks all! your changes made it work. clearing the error state was t... (by SUPPO USN)
Bubble Sort - Put in Descending Order
 
Got a question for you guys, so my program reads a file type which looks like this... Michelle 71 Marcie 99 David ...
[1 reply] : Example #include <iostream> #include <string> #include <algorithm> #i... (by Yanson)
int function not returning a value.
 
Hey people, this simple little program is not returning a value. The output is " (string) contains characters" (The number of characters is supposed to displ...
[2 replies] Last: Oh my. Lol. Thanks. Didn't notice that! Something about looking at cod... (by Notamongsheep)
is C a OOP language?
 
I know that c++ was made to add object oriented programming to C but I recently discovered the struct key word were you can create at least object looking co...
[6 replies] Last: @Canis lupus You are right - my bad :+D. The reference to C++ in the... (by TheIdeasMan)
std::for_each <algorithm> and <list>
 
I was viewing containers chart at http://www.cplusplus.com/reference/stl/ and did not see method for_each. I know vector is able to use this good, but I have...
[2 replies] Last: I tried for_each on list alone and it worked, sorry. The other code I... (by norp laslo)
Language Linkage
 
Hi, I learned that C compiler converts a function's prototype/definition to a binary format by the function name Only, while C++ compiler converts a function'...
[11 replies] Last: Your printf from the first post was a good example. Perhaps http://en... (by Cubbi)
by Karthy
Need help with minimax algorithm
 
I just can't seem to comprehend what is happing in the below code I know the theory behind minimax If someone could explain how the moves are scored and finally...
[no replies]
declare and storage allocate?
 
decalration won't allocate storage, while definition will. This is a test program: #include <iostream> using namespace std; extern int ei; int i; int ic=1; ...
[9 replies] Last: @rich1 You've got that the wrong way around. You don't want to put t... (by MikeyBoy)
name scope across files? extern, const etc.
 
To test the variable name's scope across files, I designed the following test project: the project include 5 files: variable.h (used to declare the variables),...
[3 replies] Last: Thanks, Disch! I changed the program to this, and it solved all my pro... (by northfly)
Algorithmic Initializer List?
 
Is there some way to generate an initializer list algoritmically? In the case I'm thinking of, I want to initialize a map<> to pair<key, constant> over all e...
[1 reply] : > Is there some way to generate an initializer list algoritmically? N... (by JLBorges)
Is this true
 
It is possible to change the number of operands an operator takes? I think it is false. Am I right?
[1 reply] : It depends on the operator. Most operators have a preset number of ope... (by LB)
Expression Builder in c++
 
How do to calculate the following equation"5+((56+8)/2)" using expression builder Note: the equation may change "50+((26+8)/12)"
[1 reply] : what have you got so far? (by mutexe)
by PacR
Convert int to const char * ( for a file name )
 
Hello , i found a lot about how to convert int to const char * but non of them explain correctly or sometimes dont even work. Here is my code: #include...
[15 replies] Last: Just found out how to deal with this problem, so proud of myself now :... (by PacR)
by cmong
Simple Calculator - printing the result
 
Hello, i'm making a simple calculator and have done it all right where you can input everything, all the functions are there, but when i run the program it will...
[4 replies] Last: thank you guys! didn't expect help so quickly! ajh32: although your co... (by cmong)
while and if , else combination
 
sir i'm a newbie user here and i'm also a student of IT and i'm a having a problem about this while and if , else combination i really have a problem focusing ...
[17 replies] Last: 1) Please use code tags when posting code, to make it readable: http... (by MikeyBoy)
Bisection Method
 
So I have made run the program smoothly but how can I make the column of the error part move up by one step. #include<iostream> #include<cmath> #include<ioma...
[no replies]
ARRAY PROBLEMS (1,2)
 
HELP!!!!!!! program that specifies three one dimensional arrays named current, resistance, and volts. each array should be declared in main() and should be ca...
[24 replies] Last: Please use code tags when posting http://www.cplusplus.com/articles/z1... (by Yanson)
January 2014 Pages: 1... 678910... 25
  Archived months: [dec2013] [feb2014]

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