51,593 Topics
![]() | |
Hi.I want to thank in advance for all replys. Well let's get to the problem. I need to a C++ code that will do the following: 1.User inputs a number 2.All digits of the number inputed not divisable by 2(odd numbers) must be multiplicated. (* operation ). 3.Show multiplication result. … | |
Hi, im having some problem while doing my assignment, i cant make my recursive function to loop as to get each digit from the number generated randomly. int random (int num) { srand (time (NULL)); num = rand(); cout << num << endl; if (num != 0) return num % … | |
When switch"ing" (....) If the user inputs 1, would you just use case 1: or case '1': thnks | |
problem is a little harder than I expected maybe b/c of the specifications of the problem. Help would be appreciated because I've turned this into a mess. Input is a command line argument representing int between 0 and 255 Output: convert string to binary and output as array of numbers … | |
When [code] using namespace std; [/code] are you able to overwrite it for a specific line e.g ios::app while using the fstream header? or does that mean i have to use std:: on everything else? thanks | |
Hi, I am currently developing CSP program for Vista and XP platform. I already have a CSP code, that can works fine in XP. But when it comes to Vista, it cannot work at all. Do you have any idea how to make the CSP code worsk in Vista platform? … | |
Hello is there fast way to convert c char** to std::string[] array without loop the char** ? | |
erm... anyone know what is this declaration mean? [CODE]#define LCD_DATA GPIO8->DR[0xFF<<2] /* Data bits D0 = P8.0 .. DB7 = P8.7 */ #define LCD_E GPIO9->DR[0x01<<2] /* Enable control */ #define LCD_RW GPIO9->DR[0x02<<2] /* Read/Write control */ #define LCD_RS GPIO9->DR[0x04<<2] /* Data/Instruction control */ #define LCD_CTRL GPIO9->DR[0x07<<2] /* All 3 control … | |
Hi everyone. I am new to DaniWeb, so I hope I am doing this right. I need to make a few programs for one of my classes. I understand the concepts, but there are a few points I do not understand. My questions are below, and I will bold what … | |
i am a newbie someone know where can download C++ installer? can send me the website? | |
I have some dll's which I would like to use in my program but the problem is that I donot know the functions name So I am not able to use them through loadlibrary function So how am I supposed to find the function names Please help | |
hey there... i was trying to gather some information for a project i'm currently doing by searching on google and i stumbled upon a thread reply here... it seems that you guys have a great knowledge on the matter to which i seek... my project involves creating a system by … | |
*Note: its not a fully functional hashTable for technical purposes My priority is to get it to store the strings properly. I approached this a different yet similar way to my other post and I have gotten much farther! The problem now is that my output prints duplicates each and … | |
Hello everyone, I am new to computer science, and thus far this semester I have not needed any help in writing a program even though I am stuck with a professor who struggles to get a clear point across. He is a great guy and tries to make sure we … | |
This is for a frequency table that will eventually allow me to build a Huffman coding tree. I want the class FrequencyTable to simply hold a vector of the type FrequencyNode however I keep getting an error about ISO forbiding the creation of the vector. Any ideas why? Error: [CODE]FrequencyTable.h:11: … | |
What would be the difference between something like int func1 = "This is my function" and string func = "This is my function" (sorry if syntax is off) The only thing ive been able to find in research, is that c++ offers a specific header to handle string i/o etc... … | |
hello everybody. I am trying to write a game of rock paper scissors where the user plays against the computer. The computer picks a random number and the user makes his/her own selection. then the selections are compaired and the winner is selected. I need to write the following in … | |
I'm working with existing code, where I've found that I have to modify some #include preprocessor directives. For example, to change [code]#include "myhdr.h" [/code] to [code] #include "..\hfiles\myhdr.h"[/code] I include the original line in a comment just above the changed line: [code] /* #include "myhdr.h" original */ #include "..\hfiles\myhdr.h" [/code] … | |
I want to simply put an image as background of my parent window. Is it possible to put this into the class? [code]wc.hbrBackground = image[/code] I've been looking all over Google, maybe I'm using the wrong keywords but I'm not finding anything. Anyway, on top of that image, would it … | |
I'm very new at C++ and would like to know how I would change a directory via user input? This will be a Win32 Project and [U]not [/U]a Win32 application. I know I can use (as standard - and without user input) the [U][B]chdir("\\dir");[/B][/U] - but how do I use … | |
Hi all there. I was given the task to write a simple Complex Number class as an exercise for a class I'm taking. I already met my professor and all went well (:)) but I'm left with a question which I forgot to ask her: how should I handle any … | |
[icode] struct entry { int key; } entry[TABLE_SIZE]; [/icode] i declared a struc like this... but i no that u cant declare it in this way, if i write it in the correct way i am getting errors. Y is this, can some one modify this code please .. i … | |
My code is the following: [code] # include <stdio.h> # include <sys/types.h> # include <sys/ipc.h> # include <sys/sem.h> # include <unistd.h> # include <stdlib.h> # include <time.h> # define NS 3 union semun { int val; struct semid_ds *buf; ushort *array; }; int main(void) { int sem_id, sem_value, i; key_t … | |
[icode] struct value { char c[29]; }; char toLower(char na) { char c; char str[29]; int i=0; while (na[i]) { c=word[i]; str= (char)(tolower(c)); i++; } return (str); } [B][U][COLOR="Red"]in the main program[/COLOR][/U][/B] cout<<"Enter The your name: "<<endl; cin>>v.c; toLower(v.c); [/icode] This is what i wrote to convert the insert text … | |
Why does I encounter a compileerror when doing this. Compile error says. 'Form3' : undeclared identifier 'Form4' : undeclared identifier Inside of Form4.h: [code] #include "Form3.h" Form3 ^form3 = gcnew Form3; form3->ShowDialog(); [/code] Inside of Form3.h: [code] #include "Form4.h" Form4 ^form4 = gcnew Form4; form4->ShowDialog(); [/code] | |
Hi, I've been experiencing problems when attempting to add resources to a DLL using UpdateResource. I'm adding many images to the DLL, and as soon as the overall image size reaches ~16MB, the DLL loses other resources that previously existed. Any ideas? Thanks, Gil Moses. | |
001 00002 0000003 00004 000005 6 000007 008009 ------------------------------------------------------------------------------------------------------ GBL UTG.L 0692861 DCGB 000000 0 205750 826UTG GBL UU.L 0646233 DCGB 000000 0 722501 -371UU. I have the above data line by line each and coloumn has fixed width then in those i want to assign 9 coloumns to variables … | |
can anybody help me to connect a C++ Application tp mysql database | |
i've wrote a program with a header file and a cpp file. when i try to compile i am getting errors that i can't fix, (i'm just a beginner). Code Below: [B][U]the .H file[/U][/B] [code=cplusplus] //Flexie Muirhead #: 26075046 //Assignment #2 #include <iostream>//allows program to output data to the screen … | |
Considering the given code as an algorithm calculate the time complexity of this code. #include<iostream> #include<stdlib.h> using namespace std; int main(){ int i, j, n; for(i=0;i<n; i++){ for(j=0; j<n; j++){ cout<<"my time complexity is = "<<i*j<<endl; } cout<<"complexity is increasing"<<j<<endl; } system("pause"); return 0; } | |
Hi, I working on COM Components in VC++.NET 2005, [CODE]HRESULT hr = spCrypt.CoCreateInstance(__uuidof(Cryptographer::TMMPlayerHelper), 0); if( FAILED(hr) ) spCrypt = 0;[/CODE] I am facing an error here. I debug the code and found that "CoCreateInstance()" is returning a message "Class is not registered" an my program gets crash. How can I … | |
Hi, I want to transfer a file as it is via a socket...not read the file contents and send it.How can I do this? | |
Im still a newb when it comes to programming so im just curious, i understand as far to where return(0); at the end of a function tells the program their were no errors and to end the program right? But what else can you use return(???); for? And how exactly … | |
[CODE]#include <iostream> #include <cstdlib> using namespace std; const int MAX_ARRAY_SIZE = 11; void instructions(); //Explains the program to user. void get_integers(int a[],int size); //Recieves input from user int main(){ int numbers[MAX_ARRAY_SIZE]; instructions(); get_integers(numbers,MAX_ARRAY_SIZE); for(int i = 0;i < MAX_ARRAY_SIZE;i++){ cout << numbers[i] << " "; } return 0; } void … | |
Hey Daniweb! I'm here again with another C++ problem. I am trying to add three pairs into my main vector 'theMap'. I am thinking I need to use the 'insert' function, but I just cant figure out why my syntax is working. I've tried the 'copy' command as well, no … | |
I am having a problem with a class I am writing. I have defined a whole bunch of methods defined that the compiler is telling me in the implementation are different. The errors are: [QUOTE] 1>------ Build started: Project: prog6a, Configuration: Debug Win32 ------ 1>Compiling... 1>main.cpp 1>c:\users\philip\documents\visual studio 2005\projects\cs211\prog6a\prog6a\avltree.h(186) : … | |
how can i create a c++ program that can somehow connect to a phone and let you talk to them through a computer mic? also how do i create an email program? the email program could also send txt messages (number@carrier.com). can you give me links or code and an … | |
I am having issues trying to set up a makefile in Crimson Editor. I know that I need to link my files but I am not sure what that is exactly. I have included my filename.h in my implemenation file and main. Everytime I compile i get nasty errors saying … | |
Hi, let's say I define this two classes that do not inherit from one another. I get an error at line 10: field "DataNoFather" has incomplete type. 1.Any idea what that means and how to fix it? 2. Is it possible to have a variable like DataNoSon labeled with type … | |
I am doing an online course and for one of the chapters (in [U]Practical C++ Programming[/U] by Steve Oualline) it had a bitmapped graphics section-only 4 pages long. The chapter is about bit operations and includes a section about hexadecimals. I understoodit until I got to this passage in bitmapped … | |
I have a small lab where I'm trying to dynamically allocate an array to hold whatever number of scores. We were given the code to pass it into a function that sorts those scores via pointer notation. However, when I try to pass the array into the function, I get … | |
my program has the following errors: there are primary-expressions expected before "else" the upon commening on the lines with else, i got a mistake like "core dumped" and it couldn't run no more. could anyone please take a minute to go through my programm and kindly let me know where … | |
hello i am new in the programing and i want то learn c++.Where i can find good tutorials about c++ ---------------------------------------------------------------------------------------------------------- Thanks in advance | |
[code] #include <iostream> #include <string.h> using namespace std; class Date { public : Date(); void setDate(int,string,int); void printDate(); private : int day; string mth; int year; };//end class //date constructor Date::Date() { day = 01; mth = "Jan"; year = 1990; } //setDate void Date::setDate(int inDay,string inMth, int inYear) { … | |
When i use a variable type [B]double[/B] the value [B]e.g 345624.769123[/B] rounded to [B]345625[/B] but when i take [B]5 digits[/B] before decimal [B]i.e 34562.4769123[/B] then it shows [B]34562.5[/B] Please explain Why? Thanks | |
I remade an equation-solver program from Java to C++, and I plan to post it soon but I would rather not until I can determine where modulus fits in with PEMDAS. To those who don't know, PEMDAS is the order in which mathematical expressions are to be evaluated. The order … | |
Hi everyone, Since it's the weekend, I can't get assistance from my professor or his assistant until Monday. My deadline for submission is approaching and I'd feel a lot safer getting as much work as I can. I'm implementing a hash table to store strings using linear probing. My implementation … | |
I am making a encoder/decoder program. I have made most of it but I am stuck on the last bit. I would like when i decode the text it will oopen encode.txt, read it and change it back to normal (decode) the show it on the screen. If that cant … | |
well lately I have been working on a CPU core for 6502 assembly, and I have been writing it all in c++. However for obvious reasons I was thinking of remaking the core in assembly. First I was wondering if it would be worth it (speed wise) to write functions … |
The End.