Beginners - February 2014 (Page 46)

Binary Search Not Working
 
I have no clue why this search isn't working. Two majors problems (1) As is it always returns false (2) It would recognize valid IDs if instead of setting...
[2 replies] Last: ah figured it out, I need a second variable to return. One bool for th... (by Mixelplik)
by Dcull
Inlining
 
Hey guys, So I wrote a program that is supposed to prove the improved efficiency of inline functions. My original program multiplies two arrays of doubles (o...
[6 replies] Last: specifying the inline keyword is never a guarantee that the compiler... (by Smac89)
by Dcull
Text Class Error - '.' token, expected unqualified-id
 
Hey Guys, So I am new here, and am totally new to programming. I am trying to take a c++ programming course, and to be completely honest, am lost half the ti...
[9 replies] Last: You are properly specifying the name of an argument for your construct... (by MikeyBoy)
Trying to learn loops (practice problem)
 
I have tried to solve this using different loops and loops with if statements. I keep getting compile errors no matter what I do. I finally tried a do-while loo...
[1 reply] : This is incorrect: while ( option != "1" || "2" || "3" || "4" ) Wh... (by long double main)
Copy from string
 
Hi, I'm trying to copy from one string to another. But I have some problems with the code I guess. void fun(char buffer ) { int i = 0,k = 0; while(bu...
[2 replies] Last: system("pause"); I hate this, it`s a resource hog: http://www.cplusp... (by closed account EwCjE3v7)
Cannot get the "getline()" function to work in a loop
 
For some reason I cannot get the "getline()" function to work in a loop(lines 33, 54-60). When running the program: After the first time through the loop, the p...
[5 replies] Last: If you're mixing formatted and unformatted extraction, and you don't n... (by cire)
by hbkmad
Reading and Writing binary files
 
Hello, First the code struct Product { char name ; int code; double price; }; void readDataBinary (const char* name , Product* products,int& count...
[3 replies] Last: > So everytime I want to write/read to/from file > I have to use the ... (by JLBorges)
Problem with using find()
 
Okay, so basically, I'm trying to write a basic program that will search a large text file for a word, and return it afterwards. Here's the code I have so far. ...
[2 replies] Last: It appears I had overengineered it, thank you! (by linkpwns)
using fgets
 
Is it possible to use fgets function with a dynamic buffer, and not setting its size from the beginning? int main() { FILE *FP; char* buffer = new char; ...
[2 replies] Last: Why are you using fgets()? Since this is a C++ program getline() would... (by jlb)
by Nata
reference problem
 
Hi I have to write a code, in which will be a function insert. The function should give us ability to write array in it which has to have 12 numbers in it. Howe...
[2 replies] Last: The t array reference in main() isn't needed. Here is your code, c... (by Catfish666)
File open error
 
I have an input file named "hello.tx." Meanwhile, I also have the input file opened. Everytime I compile and run th program I seem to get to get " file not ope...
[6 replies] Last: how did you call the function ? works fine on mine #include <iostr... (by nvrmnd)
c++ or python for Finance
 
Hello everyone, I would first like to excuse myself If I am posting this in the wrong place. I need your help regarding this particular matter. I have a finance...
[6 replies] Last: I am inclined to suggest you start with Python though (make sure it... (by closed account EwCjE3v7)
While loop is a bit off...
 
I have a dat file I'm trying to read and produce output from. When all the numbers are added together I'm supposed to get 199 boys, 198 girls, and 397 total stu...
[1 reply] : Using eof() as a loop condition is almost always wrong. Read: http:/... (by Peter87)
spoj question
 
http://www.spoj.com/problems/JULKA/help me solve this question please .explain why we are adding zero in end after addition of bits.as commented in code below ...
[no replies]
Junior computing contest question
 
ok so heres the question Problem J3: From 1987 to 2013 Problem Description You might be surprised to know that 2013 is the first year since 1987 with dist...
[1 reply] : inside the while loop, you're redefining a,b,c,d as local variables. I... (by zsteve)
Using pointers to iterate through char
 
Write your question here. /* this functions return true if line matches pattern e.g p_r('joker kills batman', 'bat') --> return 1. p_r('joker laugh', ...
[1 reply] : Also, pointers are not like arrays right? so how can a pointer incre... (by Catfish666)
by pintee
Changing Static Text inside modal dialog box
 
Hi, I am creating a Dialog Box in an MFC application as follows: class CStatisticsDlg : public CDialogEx { public: CStatisticsDlg(); // Dialo...
[no replies]
by ccdare
Does[code]string a = string(); same with string a;[/code]?
 
Does string a = string(); same with string a; ? Or Does valarray<int> a = valarray<int>(); same with valarray<int> a; ? I designed a class contain a string...
[3 replies] Last: > why I bother explicitly offer a default constructor when have other ... (by JLBorges)
by htx281
While or do-while loop??
 
What should I use to make this code. Should I use do-while loops? or just while loops? Or nested if and else statements? It also tells me that 3x10^(19) is too...
[2 replies] Last: The reason why you're always getting "wavelenght" is because you're us... (by Annatar)
by ccdare
Why string reference can refer to a C-style string?
 
I don't understand, why a string class reference can refer to a C-style string? const string &r = "hello"; But the following code cannot work. char ok = "...
[15 replies] Last: Thanks. (by ccdare)
February 2014 Pages: 1... 4445464748... 60
  Archived months: [jan2014] [mar2014]

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