49,761 Topics

Member Avatar for
Member Avatar for ashanu

I am new to C++ coding. I want to know how hash_map and list can work together. My requirement is: I have a structure with address elements, name My hash key should be name of address object. Using the key I should find out structure. I have dynamic list for …

Member Avatar for sundip
0
182
Member Avatar for Mehwish Shaikh

Can anyone tell me what this following statement means in C++..[B] return (tos==0?1:0)[/B] where tos is a variable.. Thanks..!!

Member Avatar for peter_budo
0
311
Member Avatar for champu8

[CODE]#include<iostream> using namespace std; int main() { int *number=new int[1000]; int c=0; int i=0; cout<<"Enter no sir\n"; cin>>number[i]; while(number[i]>0) { number[i]/=10; c++; } cout<<"\n\n"<<"TOTAL NO OF DIGITS = "<<c; delete[]number; return 0; } [/CODE]

Member Avatar for champu8
0
115
Member Avatar for johnnyboyslim

I have a two dimensional array that needs to be loaded from a data file that contains last names and phone numbers and then I need to load another array with the addresses of those elements in the array. Is there a certain way to load a phone number since …

Member Avatar for johnnyboyslim
0
195
Member Avatar for b3hr0uz

I have been working on this code for a while and for some reason I can't figure out why it won't compile I get a lot of errors. [code] #include "rational.h" Rational::Rational () { _p = 0; _q = 1; } Rational::Rational (long P, long Q ) { if ( …

Member Avatar for b3hr0uz
0
336
Member Avatar for kleyva

I have to write a program that that reads an array of integer numbers, stores them in array, sort the numbers in ascending order, and print the sorted array: using the buble sort technique. Unfortunately I can't seem to get it to work at all, and I know <stdio.h> is …

Member Avatar for WaltP
0
654
Member Avatar for shawn.reynz
Member Avatar for sfuo
0
93
Member Avatar for Tom_Weston

So, as you can see... [code] #include <iostream> #include <string> using namespace std; int main() { char comma = ','; string str1 = "hello,friend"; string str2 = str1.substr(str1.find(comma)+1, str1.length()); //i guess this line... cout << str2 << endl; system("pause"); return 0; } [/code] What is being output is str2, and …

Member Avatar for gerard4143
0
131
Member Avatar for thepriceisright

I want to write a program that determines the bill for car parking. I asked my friend to put together a description of what I want to do. Can someone look at this and give me a good code to do this? This program requires you to input information about …

Member Avatar for turt2live
-1
1K
Member Avatar for Labdabeta

What does it mean if my opengl objects are opaque from one side and translucent from another?

Member Avatar for Labdabeta
0
86
Member Avatar for Zssffssz

Ok the thing I searched into google brought up a ton of nonsense. I want to use variables from a function in main and (more important) variables from main in a function. I am already using file I/o as a loophole but I want an easier way. PS How do …

Member Avatar for gerard4143
0
169
Member Avatar for Labdabeta

here is the question, what does str(X) become [CODE]#define str_(X) #X #define str(X) str_(X)[/CODE] when X is a string? is it ""string"" or "\"string\""?

Member Avatar for Labdabeta
0
110
Member Avatar for Mona..

Hi everybody.. I have a homework on 2-Dimentional arrays, I have to creat a class and pass the parameters int it, i have to overload operators( +, -, *, << ) how do I Add the matrices?? Subtract?? and Multiply them using operator?? what should I pass and what should …

Member Avatar for Mona..
0
182
Member Avatar for Sunshine2011

Hello, I wrote a little program (Create a vector and give it back via pointer.) for a better understanding of pointers. First it works but when I would like get access to the vector alloacated with "new", problems occur. For example saving a element is not possible. [ICODE] #include <iostream> …

Member Avatar for Fbody
0
232
Member Avatar for hemj

Hi, I have to write a program which makes changes and writes to a different text file. The point at which I am stuck is that I am unable to add the value 10 to ASCII value of each of the first 6 characters in the file. Can someone tell …

Member Avatar for Fbody
0
2K
Member Avatar for linx_mt

Hello, I am so frustrated as I search the internet and cannot find solution for what I want to do... I want my C or C++ code be able to create a file in a directory under "C:\Program Files", for example "C:\Program Files\abc\xyz.txt". This usually triggers a security confirmation like …

Member Avatar for linx_mt
0
297
Member Avatar for Awah Mohamed

Hi guys, how are you all?? I want your help in writing and auto run code. I mean, a code in c++ that auto runs my c++ based applications so that when ever the pc starts, my programs start as well. How can i build it?? I have been programming …

Member Avatar for Awah Mohamed
0
288
Member Avatar for falconmick

I was curious as to why the C++ standards board/the guy who made C++ decided to make all non default constructors non explicit? Stroustrup said that with C you shoot yourself in the foot, but with C++ you blow your foot off... Why didn't they make all non default constructors …

Member Avatar for mike_2000_17
0
816
Member Avatar for JuloF26

Hi guys! I want to start learning Objective-C and Id like to use c++ streams, problem is that it is causing error on this hello world example: [CODE] #import <iostream> #import <windows.h> int main( int argc, const char *argv[] ) { std::cout<<"Hello World"<<std::endl; Sleep(5000); return 0; } [/CODE] and these …

Member Avatar for TPBarnett
0
606
Member Avatar for sunn shine

can any 1 tel me the site , from where i can install this? recently some thing went wrong with my computer and i lost my evry thng... :(

Member Avatar for Narue
0
197
Member Avatar for XodoX

I read that you can use a while loop to read the input from a text file and create a doubly linked list? How do I do that? I would appreciate if someone could show me. Thank you!

Member Avatar for EskayJoe
0
1K
Member Avatar for Zvjezdan23

In my math programming class I have an assignment to find the slope intercept formula (y2 - y1) / (x2 - x1) which is the m of the formula y = mx + b. I have to find 2 slope intercept equations and make an if-statement or multiple if-statements to …

Member Avatar for Fbody
0
312
Member Avatar for lawnmoler

Okey i know that im going to start hate with this thread, but which one should i choose to learn looking from complexity view? Which api is more "easy" or user-frendly to learn? And why so? I wana know what you think.

Member Avatar for Zssffssz
0
93
Member Avatar for ntrncx

I do an exercise and i wrote this code to test templates [CODE]#include <iostream> #include "Date.h" #include "Time.h" using namespace std; template <typename T> bool compare(T first,T second){ if (first==second) return true; else return false; } template <class T,class X> bool compare(T first,X second){ if (first==second) return true; else return …

Member Avatar for ntrncx
0
220
Member Avatar for lAmoebal

I need to create a basic program for work that utilizes the snmpget command. It needs to be usable in both windows and solaris as our clients use both. What's the best snmp library to use? I tried to download a number of them but I can't even get the …

Member Avatar for vijayan121
0
4K
Member Avatar for ratatat

help guys, this code tells me that the sleep identifier is not found. has anyone got an idea on how to resolve this?

Member Avatar for ratatat
0
80
Member Avatar for James19142

in this program i'm writing, i seem to keep getting rounded down values. At first i though it was because i was declaring my return variable as an integer so i made sure i wasnt doing that and changed all number variables in the class to doubles to ensure i …

Member Avatar for Fbody
0
159
Member Avatar for alexander1s

am writing a program that will count the votes for those whom are agree and desagreed, so i would have Yes and no, now i have to have a file in wordpad, in other to import the information that was saved, to make the program to run, but i have …

Member Avatar for James19142
0
125
Member Avatar for Zvjezdan23

This is code for the algebraic slope formula (y2 - y1) / (x2 - x1). I need help. My error is: Uninitialized variable formula2 is being used without being initialized. Can anyone help me??? [CODE]#include <iostream> #include <string> #include <cmath> #include <algorithm> using namespace std; int main() { int formula1[2]; …

Member Avatar for Fbody
0
109
Member Avatar for hiimhenryyy

Hi, This is my first post here at DaniWeb. I've been using it as a resource through out my assignments. I am truly eager to learn C++, but I've gotten stuck. All I am trying to do is average an array of numbers, but I haven't been able to even …

Member Avatar for MonsieurPointer
0
168

The End.