General C++ Programming - November 2009

weirdest code ever
 
this is an overloading function of the plus operator, weird thing is that when I make my vector larg...
[no replies]
Strange command line argument behaviour
 
I have this code which is supposed to convert an URL to the form in which it is used in a DNS reques...
[3 replies] Last: Thanks helios, can't believe I didn't spot that after staring at my sc... (by Chewbob)
infix to postfix
 
I need help with a program for converting infix to postfix. heres my main program: #define Sent...
[10 replies] Last: ok,i have other questions that have nothing to do with errors.im havin... (by kakashi316)
string arrays in a for loop?
 
Forgive me if my terminology is off. I'm using visual studio 2008 c++. I'm doing a movie rental pr...
[4 replies] Last: [quote=us3rn4m3]i will code it for you to make your homework done. ... (by firedraco)
Function problem
 
My program is supposed to take numbers from the user and should only stop when 0 is entered. My shou...
[1 reply] : [code firstline=19]while (!(num=0)) should be while ( !(num==0) ) ... (by Bazzy)
string to two's complement (1,2)
 
If I have a string "52" is there a way to convert this to it's two's complement value(in bits), whic...
[35 replies] Last: Flip bits and increment. You should already know all this. (by helios)
Sorting a Linked List
 
Hi I'm trying to sort a linked list I created using a function but I have no idea how to sort it. Ca...
[2 replies] Last: your bubble sort thing works if you preserve the starting point. do... (by herbert1910)
by tene
Binary Search in Linked List
 
An interviewer asked me to search nth node in a linked list. I gave him the logic of linear search,...
[4 replies] Last: Thats what I am also wondering.. I think its not possible to reach an... (by tene)
n-th Fibonacci number in O(logn)
 
This is recursive function to compute nth Fibonacci number and is of O(n) time: int Fibonacci(...
[7 replies] Last: I agree that a lookup table can be used with any solution. I just s... (by jsmith)
pass mp3 file through program
 
The attached code takes and mp3 file and converts it from 16bits to 8eight bits as well sends the PC...
[11 replies] Last: A * between 'const char' and the identifier? (by helios)
getline() & fstream behavior
 
I'm testing fin functions and I came across this. Does anyone have any idea why getline fails to...
[4 replies] Last: I removed an extra fin >> stringTwo statement and kept the ignore call... (by Discere Faciendo)
Question
 
I need a short example of a program with: Data structures Dynamic arrays enumerations unions po...
[3 replies] Last: Wait a second; I'm not going to do your homework for you? Haha... (by mcleano)
User Functions
 
Finding difficulty creating a user function program: Given: tanh (x) = 1-2e^(-2x) + 2e^(-4x) - ...
[1 reply] : can anyone help me with writing this code: Trying to write a larger p... (by sl02ggp)
Using Complex Numbers for Circles and Right Triangles.
 
Hello People...HAPPY BELATED THANKSGIVING...I'm having problems trying to get this Complex program t...
[3 replies] Last: Four different complex numbers a,b,c,d lie on a cirlce if and only i... (by tition)
by chrivo
Library for interactive command line interface?
 
Hi, I'm looking for a way to control my program interactively through a command line interface. S...
[12 replies] Last: Command line input is a stream, parsing input isn't difficult. Maybe ... (by Bazzy)
Writing a 2d vector of objects to a file?
 
Hello everyone, I have a 2d vector of objects that I need to write to a file and then read back f...
[1 reply] : Overload the << and >> operators for your class, then iterate through ... (by Bazzy)
by Zendet
Loop
 
hello, i have a program that i need to repeat a section of it so many times, the amount of times ...
[15 replies] Last: inb4 ............................................________ ............ (by bluezor)
Encryption/Decryption program not working
 
Hi, I tried to make an encrypting/decrypting program, and it isn't working as I planned, plus I can'...
[1 reply] : I guess because in ASCII, 1 - 3 isn't ABC? I suggest checking up a tab... (by bluezor)
Need idea for a while condition
 
Bascially, I have a string called 'fileContent' that contains the text of a file that has been read ...
[5 replies] Last: Helios: Yes thats correct: std::string createSubString(std::string... (by mcleano)
by Tex
Losing part of char array returning from function by reference
 
The contents of the array are safe within the function, however, upon returning to main the data bec...
[1 reply] : In the future, please put your code in code tags: [co de] Put you... (by Disch)
November 2009 Pages: 123... 16
  Archived months: [oct2009] [dec2009]

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