49,761 Topics
| |
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 … | |
Can anyone tell me what this following statement means in C++..[B] return (tos==0?1:0)[/B] where tos is a variable.. Thanks..!! | |
[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] | |
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 … | |
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 ( … | |
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 … | |
please help me.. contribute some codes for indegree and outdegree .. i need it badly | |
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 … | |
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 … | |
What does it mean if my opengl objects are opaque from one side and translucent from another? | |
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 … | |
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\""? | |
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 … | |
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> … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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... :( | |
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! | |
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 … | |
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. | |
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 … | |
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 … | |
help guys, this code tells me that the sleep identifier is not found. has anyone got an idea on how to resolve this? | |
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 … | |
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 … | |
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]; … | |
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 … |
The End.