49,761 Topics
| |
it's classic traveling salesman problem using dynamic programming. the peseudocode is given : Inputs: a weighted, directed graph, and n, the number of vertices in the graph. The graph is represented by a two-dimensional array W, which has both its rows and columns indexed from 1 to n, where W … | |
Hi, I'll preface this by saying I am about as beginner as it gets (the "installed compiler on saturday, open first book saturday night" kind of beginner) Basically, I have a small program that reads the current directory for any file with ".txt" and then opens and scans those files … | |
[CODE]#include <stdio.h> #include <ctype.h> int isPalindrome( char *str, int length ) { if ( length < 1 ) { return 1; /* no more chars to compare, its a palindrome */ } if ( str[0] == str[length-1] ) /* Are the two ends same? */ { return isPalindrome( str+1, length-2 … | |
So i was in a making of my homework where im supposed to write a program to write (output) 2 tables to .txt file 1) given data 2) calculations that were done with that data. heres the code [CODE] /* L3-7. Turime tekstiniame faile studentų apskaitos sąrašą: pavardė, vardas, įstojimo … | |
Hi, Good day. I want to get the attributes of an xml using libxml2 and save it to a stl map in c++? Can someone help me? tnx. | |
I know it is possible my bootmanager's installer nagged me abou it. How do I tell what bitness and mode it is I ? (ex: 16bit real mode,16bit protected mode, 32bi protected mode, 64bit long mode, ect) | |
I am trying to make a program to add, delete, and print a sorted linked list. I have tried many different things and now I am getting a Segmentation Fault so I was wondering what I am doing wrong? Here is my code so far: [CODE]//ItemType.cxx #include "ItemType.h" ItemType::ItemType() { … | |
I am trying to find the way to generate bezier curve using de casteljau algorithm for one of my assignment here. I am able to generate bezier curve using normal method but unable to start on generating using the above algorithm. It will be of great help if someone can … | |
Hello All, I am having a problem making my program display and output correctly. When i run my program my count will display but my word will just give me some kind of line. Can you please help me correct this? Thanks Ronnie [CODE] #include <iostream> #include <string> #include <iomanip> … | |
Is it possible to define a union at creation. ie: [CODE]union Colour { unsigned int i; char c[4]; struct{ char a; char r; char g; char b; }col; }Black(0xFF000000),White(0xFFFFFFFF),Red(0xFFFF0000),Green(0xFF00FF00),Blue(0xFF0000FF)/*etc...*/;[/CODE] | |
Hey everyone, I need help creating a program that will add and multiply polynomials using linked lists. The polynomials that will be added and multiplied by my program are taken from an input file. This file contains the polynomials in the form: 3 2 5 1 3 0 XXX 2 … | |
Hi everyone, I'm trying to code a calculator that performs the following operations: +, -, /, *, %, ^, !, L ! factorial = x! L log10= log10(x) and im having trouble running the code because of the last three functions. I will post my code and I hope to … | |
Write a C++ program using DarkGDK with functions that asks the user for a positive integer no greater than 15. The program should then display a square on the screen using the character “X”. The number entered by the user will be the length of each side of the square. … | |
hello, I want to use this code1 [CODE]#include <windows.h> #include <tchar.h> #include <stdio.h> TCHAR* envVarStrings[] = { TEXT("OS = %OS%"), TEXT("PATH = %PATH%"), TEXT("HOMEPATH = %HOMEPATH%"), TEXT("TEMP = %TEMP%") }; #define ENV_VAR_STRING_COUNT (sizeof(envVarStrings)/sizeof(TCHAR*)) #define INFO_BUFFER_SIZE 32767 void printError( TCHAR* msg ); void main( ) { DWORD i; TCHAR infoBuf[INFO_BUFFER_SIZE]; DWORD … | |
Hello first off I appologize if this is posted in the wrong forum and I'm sure if it is a moderator will kindly move it to the correct location. I did try to find a suitable place and this seemed the most logical choice to me, I did also try … | |
I am having problem with converting and initializing errors. Any help is appreciated. I am a 2 yr Computer Science major, so be gentle. Here is Code: Sorry its long! [CODE]// Kyle Bennett // CS 318 // Paint Throwing Disturbance #include <iostream> #include <iomanip> // set width and decimal #include … | |
Windows API Can the KEYBDINPUT structure in the INPUT structure be used to send a mouse click? I know there is a different structure for the mouse but I would like to use the KEYBDINPUT structure if possible. | |
i was working on a project to send sms through my cellphone connected to my usb, but i did it on java with the comm library and on windows, now im working on ubuntu with c++, but i dont find any library that i could use to communicate with the … | |
I have a game client that has a button to allow input and when toggled on it will block input.. Thing is sometimes even when u toggle it off, it still blocks user input.. Other times there is an extremely HUGE delay before it accepts input.. I was thinking if … | |
My teacher showed me something like this with functions but I don't quiet get it. Since, I can't ask him right now...I came here for help. I'm suppose to write a function to display days in a month. This is my first time using functions so all the help I … | |
Hello guys. I just have a problem that I think you pros will help me solve real quick.. I was instructed to make a table that will show the inputed miles, yards, feet, and inches this way: Units Value Meters Miles XXX XXX.XX Yards XXX XXX.XX Feet XXX XXX.XX Inches … | |
Hello everybody! I build a string for a system call (Matlab) like: [CODE]std::string command = "matlab -nosplash -r MyMatlabScript(" + arg1 + " " + arg2 + ");";[/CODE] The system call is: [CODE]system(command.c_str());[/CODE] However, i get an error, pointing to the first parentheses in my command string. How can i … | |
How would I write a program that writes the text in a textbox to a List Box when a button is pressed, kind of like an address book? | |
Ey all. Im folowing a c++ course and im stuck writing string or char arrays to matrices. The problem is i have a matrix of size [i][j] with random values from 0 to 3. Each of these values have to correspond to either a string or char array. 0=EMPTY 1=RES … | |
Hi, I am a newbie to coding. I am trying to implement a graph in the following format. User input: v1 v2 edge_cost 1 3 10 1 2 20 2 3 40 3 1 30 I am storing the graph as an adjacency list, so that the output should be … | |
i have included just insert function in redblacktree class. there are[U] no compilation errors but it shows [COLOR="Red"]segmentation fault[/COLOR] [/U]on running. when i am calling insert function [B]it's not even entering into it as it's not printing the cout statement [/B]at first line of insert body. i am using g++ … | |
Hi, Can anyone show me or point toward a link with a decent example of a hash table using linked list. Thank you , | |
Hi guys, I have this input.txt file and I have to scan it to get information for my project. the input.txt file has format as: 33 56 34.8 N 118 24 30.1 W 37 40 23.5 S 144 50 54.1 E So I used fscanf_s to scan the file. Here … | |
[CODE]#include <iostream> #include <Windows.h> #include <time.h> #include <iomanip> #include <string> #include <cctype> #include <algorithm> using namespace std; /*********Wallet*****************/ void blingstack(double& wallet, double& winnings, double& payoff) { if(payoff > 0) cout<< "You won $ " << winnings * payoff <<endl; wallet = wallet + (winnings * payoff); cout<<"\nYour current balance is … | |
I want to create a key in the [B]Registry Editor[/B] of Windows XP using c++ program. After this i am to write the Name and the Data(e.g value) of that particular key using c++ program. And i am to read the Name and Data(Value) of that particular key using c++ … |
The End.