49,761 Topics
| |
Hey Guys, I found an interesting website that has a tutorial for Genetic Algorithm. Here is the article: [url]http://www.realintelligence.net/tut_genetic[/url] This is the code of its author. I can combine, but there are an errors that I can't fix it. Anyone could help me to fix this. Here is the code … | |
I need to be able to call some very old C functions from a form application. What I found on line was to use 'extern "C"' to let Visual Studio know how to handle the calling parameters. But I'm getting a compiler error and not sure where it is coming … | |
Hey all. I'm trying to get the FindDaysOver function to grab the avg result from the CalcAvg function result in main. What am I doing wrong? Any help would be appreciated! [CODE] #include<iostream> #include <iomanip> using namespace std; double FindMax(double [], int); double FindMin(double [], int); double CalcAvg(double [], int); … | |
Hi, I wondered if it was possible to declare the friends of class but out of it? Like this: You have created class: [CODE]class myclass{ int x; public: bla bla bla };[/CODE] And instead of this: [CODE]class myclass{ int x; public: bla bla bla friend class someclass; };[/CODE] If it … | |
I just recently started learning C++, in the book i am learning from there is a problem that asks you to write a simple pasword program. It just asks the user the password and then displays a message wether its right or wrong after they enter it. I am having … | |
I've been playing around with this for a while and just can't seem to get it right. Any help is appreciated! [CODE]string catalog[][] = { {"item1 - 0 dollar(s) each","description1"}, {"item2 - 3 dollar(s) each","description2"}, {"item3 - 5 dollar(s) each","description3"}, {"item4 - 7 dollar(s) each","description4"}, {"item5 - 9 dollar(s) each","description5"} … | |
Hi I have to create a hash map with key as string and data as string. i have to create a custom hash function for the hash map, but i don't know how to do that.. can somebody explain and give an example from which i could understand? | |
Hi, This is my first project involving processes I am completely lost. I need to create 10 processes that run at the same time. I know that a process is a program in execution so I must write a program that executes 10 times. I used Win32 API to create … | |
Hello, I've received an homework assignment to create an array via linked list. All went well until the compilation part where i get continuous errors. Seems most of the problem is that certain classes (DSA_array) doesn't recognize the existence of other classes and their member functions (DSA_list). Here's my code … | |
let say I hv a row of text 'date' 'amount1' & 'amount2'.. by using ifstream I able to read a file, but how about I want to read the 3rd data? use seek? | |
| |
the program should have a getData function that accepts the total rainfall for each of the 12 months from the user, and stores it in a double array. It should also have four value-returning functions that compute and return to main the totalRainfall, averageRainfall, driestMonth, and wettestMonth. The last two … | |
Hello everyone, I am trying to manipulate "DYNAMIC ARRAY" Structures however I've been faced with problems wanting adding new value. Here my code:: -I use CodeBlocks and gnu gcc compiler ^ also I checked it on linux machine. [CODE] #include <iostream> using namespace std; #include "Deneme.h" Deneme::Deneme() { countReg = … | |
what I mean is from this code, when coder doesn't put any curly bracket({,}), what does the while loop scope will cover? already test with random bracket put on the code, but, the only "brackected code" that work the same as the original code is when I put around words.push_back(word); … | |
Hi-- I am new to C++ and am having trouble with this program: The objective is to take input from a file and write it to output, using the '|' character as the delimiter, but displaying it using a comma (ex, if line 1 is "1000|6 1 6 5 3 … | |
Though I would be able to figure this out but for some reason my if statements are just not working. What I'm trying to do is date validation. I call this function passing in day, month, year. The issue I'm having the the if statement. I can't seem to get … | |
[CODE] #include <cstdlib> #include <iostream> #include <string> using namespace std; bool checkleap(int year); int main(int argc, char *argv[]) {string s1; int year,month,day,inbetween,dayspassed; char dash1,dash2; s1="Today is day number: "; bool leapcheck; leapcheck=checkleap(year); cout<<"Enter a date, in the form of MM-DD-YYYY: "<<endl; cin>>month>>dash1>>day>>dash2>>year; switch (month) {case 1: 31-day=inbetween; [COLOR="green"]//Line 19[/COLOR] 31-inbetween=dayspassed; … | |
Hey, everyone~ Being the second time posting here, I'll try to make it simple but clearly as possible :) So, my assignment this time is about writing a C program to print the following star patterns: [CODE] * * * * * * * * * * [/CODE] So, here … | |
I'm beginning game development, and I started by reading Michael Morrison's [I]Beginning Game Programming[/I], which teaches how to develop a game in C++ using the Win32 API. I've had a lot of trouble with things I don't have any experience in (when I shut down my program, the process still … | |
Hello, I'm working on a project where certain characters can have multiple values.. E.g. Letter 'A' can be replaced with 'B', 'C', 'D' Letter 'S' can be replaced with 'X', 'Y' And then it would output it like this: A can be replaced with B - Yes/No A can be … | |
hello , i want to cin n numbers then to sort the positive numbers in one array, the negative numbers in another array , then to print positive array. So let me explain , i run the program , i enter the 9 , then enter 1 2 3 4 … | |
[CODE] #include<stdio.h> int main() { int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7, 8}; int *p, *q; p = &arr[1][1][1]; q = (int*) arr; printf("%d, %d\n", *p, *q); return 0; } [/CODE] | |
my project Converting the c++ program to C# program.what i do plece sugs me and help me | |
can any one write code to find out if array is sorted in ascending order from even to odd number or not ? i will be thankful . i am new self learner of c++. Thanks in ADVANCE | |
The value for PI can be determined by the series equation PI=4x(1-1/3+1/5-1/7+1/9-1/11+1/13-....) write an interactive program that asks the user how manu terms of series equation to use in approximating PI. Then calculate and display the approximation. Here is a sample run: PI Approximation Program How many terms of the … | |
Hi people. well after I started learning C++ I thought why not try out my skills in some programming so I made my first programme. It is a very basic game commonly known as "HANGMAN" to many. It still might have some errors but it works. Hope you can modify … | |
hi i am new to c++ i have problem to solve kindly help me Start with any positive number n. If n is even divide it by 2, if n is odd multiply by 3 and add 1. Repeat until n becomes 1.For example sequence that starts at n = … | |
Guys, i have a problem in insert a string in to a vector.To be clear enough i have insert "vishwanath" into a vector can any1 help... | |
I'm having a small problem with a map format that I'm making. It's essentially simple a char*[32] with each line of characters being stored in it for instance here's a hard coded version of the map and how I'm storing it: [CODE]int main () { char *mapdata[32]; mapdata[0] = "1111111111111111111111111111111"; … | |
Having assertion failure while deleting an element from a vector.What are the causes of assertion failure? |
The End.