49,761 Topics

Member Avatar for
Member Avatar for archduke83

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); …

Member Avatar for archduke83
0
255
Member Avatar for adarbyem

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 …

Member Avatar for adarbyem
0
274
Member Avatar for ahmad deeb

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.

Member Avatar for jonsca
0
41
Member Avatar for localp

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. :(

Member Avatar for Isaac Remuant
0
79
Member Avatar for gpjacks

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 …

0
252
Member Avatar for format_c

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 …

Member Avatar for VernonDozier
0
98
Member Avatar for ace8957

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 …

Member Avatar for ace8957
1
7K
Member Avatar for Hayzam_#include

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,

Member Avatar for Hayzam_#include
0
139
Member Avatar for muze

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] …

Member Avatar for Ancient Dragon
0
77
Member Avatar for salamjamal10

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 …

Member Avatar for VernonDozier
0
203
Member Avatar for jasleen12345

[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; …

Member Avatar for MattyRobot
0
105
Member Avatar for minskypooh

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 …

Member Avatar for minskypooh
0
196
Member Avatar for rozario2010

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 …

Member Avatar for jonsca
-1
542
Member Avatar for vskumar19

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 …

Member Avatar for Isaac Remuant
0
106
Member Avatar for mca.narender

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 …

Member Avatar for Ancient Dragon
0
145
Member Avatar for dhawalruud

[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 …

Member Avatar for jonsca
0
686
Member Avatar for Hayzam_#include

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 …

Member Avatar for Hayzam_#include
0
98
Member Avatar for georgy9002

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 = …

Member Avatar for gio.perez13
0
151
Member Avatar for rocktea

i have problem .this is have functional if- else, but in functional has functional recursion .is functional has recursion?

Member Avatar for Nick Evan
0
66
Member Avatar for lochnessmonster

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

Member Avatar for mitrmkar
0
117
Member Avatar for blackxswil

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 …

Member Avatar for jonsca
0
121
Member Avatar for Abayiz

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 …

Member Avatar for Abayiz
0
169
Member Avatar for mhaviv

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 …

Member Avatar for NathanOliver
0
91
Member Avatar for vbx_wx

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 …

Member Avatar for vbx_wx
0
142
Member Avatar for gpjacks

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 …

Member Avatar for gpjacks
0
262
Member Avatar for vanalex

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, …

Member Avatar for WaltP
0
64
Member Avatar for tech9x

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??

Member Avatar for WaltP
0
73
Member Avatar for liveurlifeteddy

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 …

Member Avatar for liveurlifeteddy
0
109
Member Avatar for hiddepolen

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 = …

Member Avatar for MattyRobot
0
183
Member Avatar for ayesha91

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 …

Member Avatar for dwks
0
167

The End.