49,761 Topics
| |
Hai guys, I am a newbie here, maybe you know about my problem. this is VB source code : [COLOR="Red"][B]ReDim[/B][/COLOR] parent.Individuals(maxPop) As Individual [COLOR="Red"][B]ReDim[/B][/COLOR] offspring.Individuals(maxPop) As Individual Do While bil < maxPop bil_gen = 0 [COLOR="Red"][B]ReDim[/B][/COLOR] parent.Individuals(bil).Gen(batas_gen) As Genetik parent.Individuals(bil).Genome = AssignValue(1) List3.AddItem parent.Individuals(bil).Genome bil = bil + 1 Loop … | |
[CODE] // Hangman Redo Program #include <iostream> #include <string> #include <cstdlib> #include <ctime> #include <string> #include <algorithm> using namespace std; //Functions void welcome(); void instructions(); void game(); // Types and Arrays string choice; string inst; int main() { welcome(); return 0; } void welcome() { cout << "\tWelcome to Hangman … | |
| #include<iostream.h> struct rectInfo{ float height ; float width; float area; float perimeter; }; /* write a function void gendata(rectInfo * r)to generate and assing values to the height and width member of r(value should be b\w 1 - 20 )*/ void gendata(rectInfo * r) { } |
[CODE]#define _LL_BUFFSIZE_ 2048 string lastLine; lastLine.clear(); // regardless, zero out our return string char buff[_LL_BUFFSIZE_]; // our temporary input buffer data_filet.seekg (0, ios::end); // go to end of file int length = data_filet.tellg(); // find out how large it is data_filet.seekg(length-min(length,_LL_BUFFSIZE_),ios::beg); // seek back from end a short ways // … | |
Hey, Im having some trouble with my code, it doesn't seem to stop to wait for an answer to the question about modifying the phone list when i input values in above and press Ctrl Z enter, however the code works fine when i remove the code about inputting information. … | |
I have a problem that ı could not understand. [CODE]#include <cstdlib> #include <iostream> #include <stdio.h> using namespace std; struct record { char name [20]; double ave; }; int main(void) { int x,y; struct record array1[3]; struct record array2[3]; FILE *a; a=fopen("in.txt","r"); for (int i=0;i<3;i++) { fscanf(a," %d",&y); array1[i].ave=(x+y)/2.0; cout << … | |
Hi, I was wondering if you can help me figure how to go about this problem. This is what I have to do: Write a programme to generate an array of 100 random integers. [B]While the array is being filled incrementally, produce a sorted array by comparing the new element … | |
There are n persons numbered from 0 to n - 1 standing in a circle. The person number k, counting from the person number 0, is executed. After that the person number k of the remaining persons is executed, counting from the person after the last executed one. The process … | |
Hi, I've been working on this code but recently there's been a problem with a section of my code, this being that there was a stack overload but now, the code just stays in a loop saying that there is an invald arguement. I don't know how to get it … | |
I am doing a project for school that requires me to make a program that asks the user to enter a date by selecting two options for the format 1.MM/DD/YY (in numbers) 2.Month ,DD, YY (with the name of the month entered) both options should then display the date in … | |
i m confused about sprint syntax- i need to create dynamic mysql query so i have to use it, when i take char * it shows a error while when i take char arr[100] (like this )it work fine.. i read syntax from sprint from multiple sites, and it make … | |
Hello DaniWeb! I've been struggling with a small detail of this program for a few days now, and haven't come up with any solutions on my own. The basic gist of the assignment is to fill an array with random numbers, sort it, and then search for a number in … | |
Hi friends, I know this is such a freak code, but out of curiosity I did it to see memory usage increase using new operator. [CODE]int main() { char* a; for (;;) { //cout<<&a<<endl; a = new char[10]; } }[/CODE] As you see line7 is commented. When i run this … | |
I have a program where I have to put an input file in. Can someone tell me which direction to go in to where i can have my program calculate the data from the input file? | |
Okay so I know practically nothing about creating mathematical applications in C++ but am trying to learn. Practically everything I search for isn't anything close to what I need. Basically, I need to lean how to make a calculator style app first before continuing on, however I can't find anyone … | |
Ok! so im making a simple highscore type thing. the person plays the game and receives a score within the game. At the end of the game i have it currently comparing the score received with the score already in place within the highscore text file. the problem im having … | |
This is a function that will find the factors of a given number for you. EDIT: Better algorithm using vectors (thanks all at cprog :) ) | |
hi . plz I need you to explain for me how i can write a function that return the mod of array with n value . i think mod is that sample mode is it ? i am try to solve . but my code print the number taht is … | |
Hello everyone, this is my first post. I am working on a school assignment and I am stuck. The assignment involves reading a file that contains course subjects and the maximum number of students that can take the class. The contents are entered into an array sorted alphabetically by the … | |
I've been snooping around trying to figure whether or not this was completely safe. I've noticed that if you were to simply "delete this" you might have occurrences where the deleted pointer is still in use elsewhere in the program. To prevent this, you'd need to dereference it and perform … | |
Please Help how can i delete a lines from may .txt file someone help me :D my .txt file had a data please so body help me :D:-/ | |
hi there am wondering about the space between the [COLOR="red"]"[/COLOR] and the [COLOR="red"]%[/COLOR] scanf([COLOR="red"]"[/COLOR] [COLOR="red"]%[/COLOR]c",&choice); what's the different if i leave no space? | |
I am writing an importer for a custom export script to load mesh information for models. I tested my algo with small files, 20-30 kb of information with success, but when I try something bigger like 400kb(not that big mind you), the file fails to open. This is the significant … | |
ok lets say that we have the numbers 5,67 and 128 (the numbers are randomly entered) i want in first loop read the last digit means 5,7,8 in the 2nd pass i want the tenths so will be 0,6,2 in the 3rd will be 0,0,1 and so on. what i … | |
Hello, I have this on going project for my C++ class, dealing with a random number generator guessing game. I'm on the last step, finally. I gotta add functionality to output the array of guesses to a file after the answer has been guessed, and I need to include exception … | |
first i am creating socket, with that socket descriptor i am sending some no. of bytes through sendto(....) function. At the time of receiving through recvfrom(....) function, my code was hanging if the specified destination address is not available. Suppose if destination is available the it's working correctly... Why this … | |
Hey. As you know I'm a newbie in C++ and I'm learning from some source codes and eBooks. I don't know if the problem is to me but when I try to compile the code an error shows. I don't know if I should copy this code but I read … | |
I've been trying the last few days to get this code to work but it still wont return the exact numbers. Its always atleast like 10 characters off and it probably is a trivial answer but I cant find the solution. I've initialized the charCount to 0 but still it … | |
Hello World, I'm a c++ beginner and i've diced to study. So this is my first code: [CODE] #include <iostream> using namespace std; double d = 2.2; int i = 7; void some_function() { d = d + i; i = d * i; printf("%d\n", d); printf("%d\n", i); } int … | |
i want to know the sequence of values tobe printed out by this algorithm count = 0 while(count<2) print the value of x x=x+2 else print the value of x my answers are as follows 0;2 i need clarity |
The End.