General C++ Programming - February 2011 (Page 19)

by Lucrin
Int to String Conversion
 
Hello, I am programming a calculator for a class. The program takes in input in decimal, binary, trinary, hexadecimal, murnified, mayan, or positionless and con...
[2 replies] Last: Found my error. Needed to call DCMLConversion for numToConvert after t... (by Lucrin)
Sequence points in aggregate initialization.
 
#include <iostream> using namespace std; struct aggregate { int i; int j; }; int main (void) { aggregate s = {5, s.i }; cout ...
[12 replies] Last: I know what you mean. Again, I really appreciate the effort. My conclu... (by simeonz)
LNK2028: unresolved token (0A0003FA) "extern "C"
 
Hey, Yeah I'm at it again, I'm trying to compile a C++ DirectX project and having major issues (maybe not major but still) I keep getting the following compile...
[1 reply] : Actually this doesn't matter I just figured out that I was linking wit... (by joro550)
by sjeps
Pipe problem
 
Hi everyone. I have an external lib that prints some lines with printf. I'd like to redirect that lines and use them in another function i'm running.. ...
[3 replies] Last: Try something like this: // test.cpp #include <iostream> int mai... (by moorecm)
Function call within if statement
 
I've got a function f which returns a double. I'm calling that function within an if statement as follows: if (f(...) > 0.1) cout << 1; else cout << 0; I...
[3 replies] Last: Generate the assembler output for the above code and see if it is gene... (by jsmith)
by mfox
Embed txt resource instead of fopen external.
 
I'm currently using fopen to load an external file and do what I need with the data inside, see below. Myfile = fopen ("text.txt", "r"); if (!Myfile) ...
[3 replies] Last: You'll notice that in my example I specifically got a pointer to char... (by Duthomhas)
by jrok
String comparison code crashes
 
Hi, I'm writing a program that basically reads in a text and scans it for various occurances of some predifined strings and then if there is a match, I write in...
[4 replies] Last: Hey, thanks PanGalactic. That fixed it. I'm also trying to check if th... (by jrok)
Array Trouble
 
I am having trouble when assigning values from one array to a multidimensional array. I am getting a AccessViolationException. // Create space n...
[5 replies] Last: FIXED CODE: // Create space nSamples = Header.Data_Hdr... (by lmcgrath)
by abakiz
Polymorphic Constructors
 
Basically, when I create these class's doing this: CPlayer* List_Players ; List_Players = new CDog(); List_Players = new CCar(); the values fro...
[8 replies] Last: Ok, so we are seeing eye to eye on this. I think you are on to somethi... (by smcguffee)
by ycai77
conversion between const to nonconst
 
Anyone can explain why the second output is 0, rather than 1. #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; int...
[9 replies] Last: True, but it was just about the particular 'away-optimizing' problem. (by Kyon)
Interesting task
 
ok so who can solve this task: you have an input file which is input.txt in that file you have: Question Answer1 Answer2 Answer3 (etc..) Now on the first...
[3 replies] Last: Sounds like a home work assignment, what have you done so far? ha... (by jteally)
by Neo7C7
arrays & strings
 
I have to swap the internal characters of words after using getline. I have the following code for changing the words: string word; for ( i = 1; i < word....
[3 replies] Last: @Athar It starts at 1 instead of zero because the first and last char... (by Neo7C7)
read from a file token by token
 
how to get characters token by token when we have more than one tokens by using get method. get ( char* s, streamsize n, char delim ) how can i pass more...
[6 replies] Last: yeah, strtok() is much more suitable for multiple delimiters. thank... (by bfaskiplar)
Problem drawing with a for loop
 
Hello everybody, I am writing a program to make a coordinate plane with a for loop but it is giving me some grief... i am trying to draw this: " ^ ...
[1 reply] : This: if (i = 5) cout << "^"; should be: if (i == 5) cout ... (by filipe)
by jay75
reading in from a list using fgets
 
i need this solution using "fgets" i have a folder(3dsimages) of images. eg. left0000.png right0000.png left0001.png etc. etc. i have ma...
[3 replies] Last: http://www.cplusplus.com/reference/clibrary/cstdio/fgets/ windows i... (by hamsterman)
i dont knw y it being overwritten again again
 
#include<iostream.h> void return_path(char *a); char* return_file(char*a,char* ret); void main(){ char arr ; cout<<"enter the path: "; cin>>arr...
[2 replies] Last: @nickPaul thanx mate!!!!!! GOD bless YA :D (by waleedbinahmed)
by satya
complexity of math operations.
 
Hello All, Can i get to know the complexity of log operation?
[2 replies] Last: Thanks Athar... (by satya)
by aatwo
PCI Sata
 
Hey guys. I have a PCI adapter that has 4 sata connectors on it, and I would like to write a C++ program that can communicate with drives hooked up to my comput...
[no replies]
accessing private member of a friend class with a friend function
 
Hello, I was reading code and I saw a friend function access a protected member of a friend class. To be more specific, I saw a friend function in a matrix clas...
[2 replies] Last: Yes, that was it! thanks a lot. (by CrypticMetaphor)
Timer Problems
 
Hi...I want to create a timer so that after completing the time(suppose 10 sec) the control should come out of the function..Please note that am starting the ti...
[7 replies] Last: fun() { //timer starts here (Say 10 sec of time limit ) fun... (by kumarcr09)
February 2011 Pages: 1... 1718192021... 25
  Archived months: [jan2011] [mar2011]

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