Beginners - June 2014 (Page 25)

by CDavis
Functions average
 
I know this is a simple problem but I know i'm missing something in the array but not sure what. The assignment: Write a function that takes an array of int...
[1 reply] : result = (double) array / 7; You are accessing element with index 7... (by MiiNiPaa)
by tdk93
reading from file, prints twice
 
If the text document is like this "Gone baby Gone" It prints out the same sentence twice But if multiple lines are present like "hello world" "the world i...
[1 reply] : There's a logic error. When the fgets reads the last line from the f... (by Chervil)
returning object seg faulting
 
I've written a member function which returns an object of the same class. But it seems to seg fault. I can't pinpoint where because gdb is just giving questi...
[6 replies] Last: Ah, thanks. I removed internal_string = str.internal_string; ... (by rozick1)
by Daneos
MS SQL Library?
 
Hello everyone, Im very new to c++ and dont have very much experience. But Im working on a programm and for that programm I need ms sql connection. Ive alread...
[no replies]
sorting
 
Can someone tell me which type of sorting is this? void SortData(int list , int no) { int i, index, j, largest; for(i=no; i>=0; i--) { largest=...
[3 replies] Last: Insertion sort is completely different algorithm: http://www.cplusplus... (by MiiNiPaa)
Trying to use example code, is it broken?
 
I have a query in relation to this website: http://en.wikibooks.org/wiki/OpenGL_Programming#The_basics_arc From an example page i found a link to the source c...
[7 replies] Last: When you use an external library, there are two steps: 1. You need t... (by Stewbond)
by lays
Does read and write in fstream has buffer internally?
 
I'm trying to write a code copying contents of one file into another. Here's my code. char temp; ofstream fout("good.txt",ios_base::out|ios_base::binar...
[2 replies] Last: Although the buffering will help enormously with the efficiency, copyi... (by Chervil)
Help sorting/char arrays only
 
My brain is fried. I have been trying this all day. Everyone I seek help from ends up confusing me more because they solve it using concepts I don't know and th...
[2 replies] Last: And to add to that, since you don't have plain chars you need a functi... (by Serious Sam)
subtract one array from another
 
Hi, i have two arrays a ={2,5,7,9}, b ={5,7} How can i get an array a={2,9} Here is my code, but it's not correct. for (int j=0; j<lengthA;j++){ for (int i...
[3 replies] Last: You could make a third array in the function, then copy all values of ... (by Serious Sam)
by h4ever
best practise to work with path
 
I get path from command line parameter where path could be written in 4 different ways testdir ./testdir c:/my path/testdir I would like to know how to prepa...
[1 reply] : Isn't this platform dependent? ./testdir should work on Linux, but I d... (by Serious Sam)
Compress array of BCD values /C++
 
Write your question here. Dears, Kindly I have array of BCD values and I need to compress the size of it. I used many compress mechanism like minilizo and Gz...
[no replies]
by mehak
Inheritance
 
class Base { public: int m_nValue; Base(int nValue=0) : m_nValue(nValue) { } } is it the same as class Bas...
[3 replies] Last: Just like the other answers, I see two differences: First optional p... (by Stewbond)
Fibonacci numbers using doubly linked lists
 
I'm writing up a program to generate the nth fibonacci number, and I have the program working like a charm up till the 46th fibonacci number. The general ide...
[3 replies] Last: The normal way to do this would be to use a: class BigInt { public: ... (by cire)
don't know what's wrong, compiles and runs but breaks
 
I'm trying to count a given text files words and letters, and sort the words alphabetically. It compiles but after I enter in the file name the program breaks. ...
[1 reply] : You have several functions that promise to return values, but don't al... (by cire)
vector
 
Can someone explain to me in details regarding this code vector<string> wordlist : dictionary (wordlist) thank you
[2 replies] Last: I am also interesting about this syntax. I guess it's using C++11 syn... (by h4ever)
by mehak
possible permutations of a string
 
i am trying to print all possible combinations of a string but em getting garbage values.please help! #include <stdio.h> #include <string.h> void perm(int...
[2 replies] Last: oh tht where i made a mistake.tnx alot (by mehak)
Linked Lists in Classes - Program Not Working
 
Hey there I'm having trouble with coding linked lists as a class. This is my "Lists.h" file: #include <string> #include <iostream> using namespace std; ...
[2 replies] Last: Thank you sooo much, kind sir!! Fixed my problem, plus, I was getting ... (by TweedleGun)
Random numbers
 
So i've this problem with this array It is assumed that the values ​​of the array must be random, but the only number listed is 897. This have to work w...
[1 reply] : You need to seed a rand() function, however you will have to add a lib... (by Jakee)
Creating Strings from char arrays
 
Hello! I have a problem that needs me to load a char array from a file, make every line of that array into a string, and then sort the strings. EX: bgtf ...
[9 replies] Last: Thank you. That helped. (by Bluebaron)
Need Help with this simple math problem
 
Write your question here. I have a formula. PV=FV/(1+r)^n Fv = $250.00 the letter r is rates in percentages. so 5 % is 0.05 n is the numbe...
[2 replies] Last: I figure it out. Sorry I posted too soon. Here is my working program ... (by Youbob1212)
June 2014 Pages: 1... 2324252627... 48
  Archived months: [may2014] [jul2014]

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