49,761 Topics
| |
[CODE]class Node { public: string name; list<string> edges; };[/CODE] [CODE]list<Node> nodes;[/CODE] Hello, Can you help. I used this class that you gave but i've struggling to add anything. I tried nodes.name.push_back(str); but no use, and also i tried nodes::name.push_back(str); i also tried to compare sections by trying nodes[i].name == temp; … | |
what is wrong with my code? in inputs like "radar" or "tttt" should say its palindrome. [CODE]#include <iostream> using namespace std; bool testpalindrome(string,int,int); int main() { string wordX; bool result; cout<<"Enter string: "; getline(cin,wordX); result=testpalindrome(wordX,wordX.length()-1,0); result==true ? cout<<"\nthe string is palindrome!" : cout<<"\nthe string is NOT palindrome!\n"; } bool testpalindrome(string … | |
I want to write a simple c++ program that allows me to edit my database tables.Each table stands on its own(no table is related to another).The UI i want is simple.I want my tables to be shown as follows: [LIST=1] [*]Table-One [*]Table-Two [*]Table-Three [*]Table-Four [*]Table-Five [*]Table-Six [*]Table-Seven [*]Table-Eight [*]And-So-Forth [/LIST] … | |
Newbie to C++ but i am a Java programmer. Trying to learn C++ now. Reading the C++ Primer by Stanley Lipmann. I don't understand this sentence in Chapter 3 about library types. He's talking about library type string and vector. "These library types are abstractions of more primitive types - … | |
[code]#include <iostream> #include <WinSock2.h> #include <mysql.h> #include <string> #include <vector> #include "action.h" using namespace std; MYSQL *con; st_mysql_res* res = NULL; MYSQL_FIELD * field[200]; MYSQL_ROW myRow; CAction * m_pActionList[1000]; int LoadActions(); int main() { con = mysql_init(con); if(!mysql_real_connect(con,"127.0.0.1","test","test","account_zf",NULL,NULL,NULL)) { cout<<"Error connected"<<endl; system("pause"); exit(-1); return false; } LoadActions(); system("pause"); return 0; … | |
how can i make table like this : For example: Fadi recommendattion ----- ---------------- 1212 you must at least gain :1kg if fadi>1212 you must at least gain 1 kg how to make a table like that in c++ and i want to put the result of if in recommendation … | |
| I have a little problem with strcmp here,the following code basically opens a file and writes to it until I enter "\esc",at which point the program should stop....but the problem is,it does not,and I can't figure out what might be the prob.Thanks for your time(I am using turbo c++ 3.0 … |
I'm trying something like this [CODE]void receiver (char* x) { cout<<x<<endl; //prints "a" cout<<*x<<endl; //prints "a" cout<<&x<<endl; //prints address of x } int main() { char p = 'a'; cout<<p<<endl; //prints "a" cout<<&p<<endl; //prints "a" receiver(&p); } [/CODE] In the main function for both p and &p, it is printing … | |
[CODE] #include <iostream> #include <ctime> #include <cstdlib> #include <string> #include <algorithm> using namespace std; //Types and Arrays string word[16] = {"GOLDFISH", "COMPUTER", "ANONYMOUS", "JACKET", "SHARP", "SERVICE", "EFFORT", "CHARACTER", "CHANGE", "WITHOUT", "PRODUCT", "UNFOLDS", "MUSIC", "MOMENT", "LIFETIME", "PROVIDE"}; char guess[50]; static const char Y= 'Y'; static const char N= 'N'; char ans; … | |
Hello. I want to make a game card that is played by two players who are on different PC's and playing via internet. I am new at network programing(I guess that is called socket programing), so I don't really know from where to start, I have done some digging on … | |
Hi guys, I'm supposed to make a program that calculates how many months it would take to pay off your credit card balance with a 14% yearly interest rate. I've written out what I believe to be it but I end up getting this. [url]http://omg.wthax.org/error_2.png[/url] The program doesn't seem to … | |
Hi, I'm trying to make a program that will write to a file and tell it that the next time that the program is run to not do the first part of the program. [CODE] fstream install; //this is what all of the tutorials say to do. install.open(ready.txt); //this is … | |
I have a big problem. Wheb I try to automate Outlook, I need to make a wrapper...My outlook version is 14. Unfortunatelly I need my proggy to work on all versions of Outlook. how to do that? My code to send email is: [CODE]string allbody; System.Diagnostics.Process.Start("outlook"); Outlook._Application oApp = new … | |
I'm really lost on this topic. I'm trying to study for an exam. 1)When the symbol '&' is in front of a variable, it is referring to the address right? How is it different from a reference parameter? I keep getting them mixed up. 2)By dereferencing it, it means that … | |
here are some questions that i have to improve my code readability since i study alone and my code starts to be more big and more chaotic i have some questions that maybe will sound silly to more but i have to ask someone. 1- its better to declare global … | |
I have not worked with the debugger at all and I have a assignment to debug a program. I don't want just the answer I need help using the debugger. Correct the Logical errors in the code so that the output of the program appears as such: * ** *** … | |
So, I need to find a way to create a way for the computer to ask for input, for this example lets make it 1 and 2. 1 for yes and 2 for no. [CODE] int yes; int no; cout << Do you like orange chicken?" << endl; cout << … | |
Hello every body The doctor gave us to solve this assignment i tried to solve it but i could not can you tell me how i solve it please the assignment is attached and this is my code: [CODE] #include <iostream> #include <iomanip> //FOR SETW #include <climits> using namespace std; … | |
Write a program that simulates the “heap” using a linked list. This program should take one node of size 9096 kb. Assume all request will be made in kb. The user should request a size of memory from the system, then the system should find memory that can be allocated … | |
Hi, my homework problem is to convert minutes into hours AND minutes ex. 124 minutes = 2 hour(s) and 4 minute(s) (there will be some if statements for plurals of hours and minutes if possible) This is my code so far but I'm getting an error [CODE]#include <iostream> using namespace … | |
Hi, I am trying to add 2 menuItems to a toolstrip menu. I cant get it to work and wonder what I am doing wrong. Also I like to add a click event to those items each that will open up the respective URL for each item "http://www.google.com" and "http://www.yahoo.com" … | |
I need help with a program for a class. I got all the issues taken care of but this one: error C3861: 'menu': identifier not found My program code is (I know it stupid but I can't see it) [CODE]#include <iostream> using namespace std; int main ( ) { int … | |
Hi. This program is pretty much working. I just can't figure out how to compare the higher hand when each player get a pair/three a kind. CardDeck.h [CODE]enum Suit {clubs, diamonds, hearts, spades}; //---------------- C L A S S C A R D ----------------------------------------- class Card // this class describes … | |
ERRORS: 8 C:\Documents and Settings\csc182\Desktop\devc++\ellipse.cpp `main' must return `int' C:\Documents and Settings\csc182\Desktop\devc++\Makefile.win [Build Error] [ellipse.o] Error 1 what does this errors mean?? here is the code.. #include<stdlib.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int x,y,i; int g=DETECT,d; initgraph(&g,&d,"\tc\bgi"); cleardevice(); x=getmaxx()/2; y=getmaxy()/2; settextstyle(TRIPLEX_FONT, HORIZ_DIR, 3); setbkcolor(rand()); setcolor(4); outtextxy(30,100,"Press"); outtextxy(30,130,"any"); outtextxy(30,160,"key"); outtextxy(30,190, … | |
#include<iostream.h> class A { public: read() {cout<<"read"; }}; class B:public A {public: readb() { cout<<"readb"; } }; class C:public A { public: readc() {cout<<"readc"; } }; class D:public B,public C { public: readd() { cout<<"readd"; } }; main() { D d; //d.read(); d.readb(); } am getting error for this... | |
i want to know what will be the sequence of values to be print out for the following algorithm using trace table count=1 count=count + 1 while(x<2)prin the value of x elseprint the value of x My answers is 0;2;2 idon't know if they are correct | |
1. a cow is defined as a guessed digit which is correct in value but not in position eg a secret number is 1234 and users guess is 2890 the result will be one.creat a value returning function called calcCows which accepts array parameters representing the user's and the secret … | |
Hello all. I am new to c++ and and our teachers have started Object oriented programming.. I am facing real trouble in understanding the concepts of constructor and destructor. Why are they used and how are they used.. Please post... | |
Hello, I have just started to learn C++, and so I got my self a copy of "TEACH YOURSELF C++ IN 21 DAYS". 1/ Could someone pls say if this book is suitable for a new a newbie. 2/ And what about it's counterpart, " TEACH YOURSELF C++ IN 24 … | |
I'm creating a library that easily adds a bunch of debugging features to c++ programms. At the moment I have these features: - A more useful assert dialouge. - Pointer validation using IsBadReadPtr/IsBadWritePtr. - Memory leak tracking. I'm trying to think of other features I could add to this. What … |
The End.