49,761 Topics
| |
hello, im just trying to translate a 1d TV denoising function for matlab, which can be found here [URL="http://cnx.org/content/m31292/latest/"]http://cnx.org/content/m31292/latest/[/URL], to C++. Here's my attempt: [CODE] inline vector<double> tvDenoising(vector<double> data, double lambda, int Nit) { vector<double> J (Nit); int N = data.size(); vector<double> z (N-1); fill (z.begin(),z.end(), double(0)); vector<double> diffZ (N-1); … | |
Hi all, the search function failed to yield any results for me so I come here to create a new thread. I'm learning C++ on my own (sort of a weird hobby of mine to learn code, don't ask) and had an interesting question... Consider the following: Ingredients.h [code=c] #ifndef … | |
a program that prompts the user to insert a positive integer number and send it to a function that will prints all the prime number from 0 to this number. Hint: use nested for loops. | |
I need some help to write to a MySQL database using C++. any basic tutorial will be appreciated. I did google but couldn't find a beginner tutorial. I am sort of lost here. :( | |
This is a program which declares two vectors of 6 elements each of type double. One vector is named weight and the other is named rate. The program uses a loop to prompt the user for a weight in ounces and a postage rate for that weight and then stores … | |
| can any one identify any problems in my code? it keeps crashing once it reaches the else condition. [CODE]void path(char paths[][70], int sROW, int sCOL, int fROW , int fCOL) //recursive path function { if (paths[sROW][sCOL]=='E') { for(int i=0; i<20; i++) { cout<<endl; for(int j=0;j<70; j++) { cout<<paths[i][j]; // display … |
Hi all, So I have reached a kind of impasse on my current project. I'm trying to make a program that can function like a phone book, loading information from a file into a binary search tree and performing operations on said information. The issue I'm having appears to be … | |
Hi i wanted to make a software that can "Off" and "On" a computer fan connected with a usb can i make it in c++?? i have 1 year experience doing C++ Thanks, | |
hello guys...i am trying to compile this project but getting this error. I have specified all the neccessary libraries and include files but I dont know why it is looking in wrong direction and showing me these errors It says [B]LINK : fatal error LNK1104: cannot open file '..\..\..\wrong path\src\debug\file_name.lib[/B] … | |
Hello all, Please help me if you can: my question is [B]what is the efficiency of the queue's insertion and deletion operations when the ADT list's implemetnation is a. Array-based b. Pointer-based[/B] Give me a hint if you can. I am new to the C++ world so please forgive me … | |
[CODE] #include<iostream> #include<cstring> using namespace std; class city { protected: char *name; int len; public: void getname(void) { char *s; s= new char[30]; cout<<"Enter city name: "; cin>>s; len= strlen(s); name= new char[len+1]; strcpy(name,s); } void printname() { cout<<name<<"\n"; } }; int main() { city *cptr[10]; int n=1; int option; … | |
The problem is to create a console-based program that prompts the user for name, student number, course, and grade (50-100 whole number only). After the input, a message should be displayed depending on the grade. The program should display an error message and terminate immediately if there is an invalid … | |
hello -i'm a student and i have been given the task to develop a P2P Voip application. - the program should work on Local network and adhoc network (and internet if possible) without server. -The program should have an address book to add unlimited user name with the ip and … | |
Hi all, I have a structure for which array of objects are created Now i want to return that array of objects to a function just like below: struct mystruct s[5]; . . code . return s; in the function i captured using *s void myfun(mystruct *s) but i am … | |
Hi, I am working on a VC++ (Visual Studio 2008) Module and i am new on this module. This module is working on 32bit fine, i need to convert this in 64 bit. I installed x64 bit compiler and select 64 bit in Project Properties. I got following error while … | |
[code] #include<iostream.h> #include<conio.h> #include<iomanip.h> #include<stdio.h> #include<stdlib.h> #include<fstream.h> #include<string.h> int n=0; // current no. of players ( to add to next one) int num=0; // total number of players class date { public: int dd; int mm; int yy; }; class players { public: char name[30]; date dob; char userid[30]; char … | |
Hi i am new to qt but i have programing experience in c++ in dev - c++ after i moved to qt i thought i could start like this if i press a button it should output hello world it is just showing me 1 error system was not declared … | |
Hi all; I need help with a program, where its a game where users are to guess a randomly selected number. The user has a max of 1 - 100. [code] class CScoreboard { private: string players_name; int round; int guess_avg; int total_score; public: CScoreboard() { players_name =""; round = … | |
i have problem .this is have functional if- else, but in functional has functional recursion .is functional has recursion? | |
for some reason the createremotethread() function is failing when i try it on calc.exe, or notepad.exe....when i use getLastError() it returns an error code of 5 : ACCESS_DENIED anyone have any ideas how/what i am doing wrong? and yes i am using OpenProcess(CREATE_THREAD_ACCESS, FALSE, ProcessID); -thx | |
Can someone point me where did i do wrong on the coding below? [CODE] class Course { private: string nameCourse; <-- is this correct? int totalOfCourses; public: void registerCourses(string course[], int numberOfCourses) { totalOfCourses = numberOfCourses; for(int i=0; i<totalOfCourses; i++) { nameCourse = course[i]; } } void displayCourses() { cout … | |
Hello! I am trying to read some data from an existing .txt file, actually that data consists of three columns, and dozens of raws. I can read it and write it to another new .txt file, but the problem is, it generates only one column with all those data, which … | |
Hi all, I have written a simple function to compute factorial in C++. It computes OK until 31! which is 738197504. Now for factorial 32 it gives me a negative result and for 34 it gives me 0. I know that on my machine LONG_MAX is 2147483647. So in my … | |
I`m getting the following error in my code(line 65): [code] error: expected constructor, destructor, or type conversion before ‘*’ token [/code] [code] namespace SocketSpace { class Error { public: Error(const std::string& msg = 0) throw(); const char* what() throw(); ~Error() throw(); private: std::string message_m; }; class Socket { public: void … | |
So, I am in the mid part of my C++ class and am having trouble with a vector project at the end of the chapter. I don't expect the answer, but if someone would point me in the right direction I would greatly appreciate it :) #1). Write a loop … | |
Hello everybody! I want to ask something that crossed my mind today about strcpy..I wrote the following piece of code and although i didn't expect it to work..it worked! [CODE] #include <iostream> using namespace std; int main() { char name[20], *dname; cout << "what's your name?: "; cin.getline(name, 20); strcpy(dname, … | |
i want to find the number in a string and then store it into int, i tried sub string, but the compiler tells me that i cannot convert string to integer. what can i do?? | |
Hello everyone, i got a question, but cant figure it out here's the question: Declare a structure to hold the time. It should have 2 members: one for hours and one for minutes (each as integers). Declare another structure for date. It should have 3 members: one for day, one … | |
Hi Daniweb! I couldnt find my problem anywhere else on this forum, so I decided to make my own thread... My problem: I'm trying to make a function to decide how many decimals a 'double' has. My code (slightly edited, here's the base of it): [CODE] // int m = … | |
HEllo this is reaaally urgent, the deadline is within less than an hour and thirty minute, and I lost hope that I can fix the problem myself. I know it has to do with pointers and allocating memory dynamically. The assignment was to use operator overloading to add two sets … |
The End.