49,757 Topics
| |
Well, I read that endl 'flushes' the output buffer as opposed to \n. Now what does that mean (In what way could that be useful)? | |
I'm trying to write the code for the Game of Life program, using arrays and for loops. I based most of my code on what my teacher did in class and modified it to fit the requirements of my assignment. I've hit a wall, though. When I execute the program, … | |
Hi there, I tried to compile a c++ code but got a fatal error. I should include net/netdb.h into my directory,but i can't find it anywhere. is there any website to download net/netdb.h?? | |
I'm up to finish an assignment for my C++, but there must be some thing wrong with the codes.... hope someone will able to give me a hand~ so...here's the title assignment: Program generates a random math problem, dealing with the : addition, subtraction, multiplication, or division of integer values. … | |
I have made a grid and want to put text on each text block. can it be like some align command in graphics.. which allows us to align the text in each block... plz help me out with this.... | |
Hey Fox... i wrote the program for finding the Mean of 4 integers (Thanks to Daniweb members) now im faced to also get the standard deviation of those numbers x=sqrt(X1+X2+X3+X4)/3 here's what i've come up with so far... [CODE]#include <iomanip> #include <iostream> #include <cmath> using namespace std; int main(void) { … | |
Everytime I run this program and enter a new record, it gets terminated on these statements: [CODE] stud.pcent=((stud.mhin+stud.meng+stud.mmat+stud.msci+stud.msst)*100)/(mm.hin+mm.eng+mm.sst+mm.sci+mm.mat); fwrite(&stud,recsize,1,file); [/CODE] The whole program is this. It is only partially complete. [CODE] #include<conio.h> #include<iostream.h> #include<stdlib.h> #include<string.h> #include<stdio.h> #define UARROW 72 #define DARROW 80 #define ENTER 13 #define ESCAPE 27 int key; … | |
Hey guys... had a little problem while trying make this little program that would find the mean of 4 integers... here's what i have so far [CODE]#include <iomanip> #include <iostream> #include <cmath> using namespace std; int main(void) { int X1; int X2; int X3; int X4; int X; cout<<"Enter The … | |
Hi everybody ^^ I'm quite a newbie in loading image file, so I've try to improve myself by loading the TGA image structure (You can found it at [url]http://en.wikipedia.org/wiki/Truevision_TGA[/url], I'm quite believe in the information there) My problem is after loading and draw it onto the screen using OpenGL ES, … | |
I am a beginner in c++ and now i reached in array processing binary search. my program is being compiled but it is not showing any result. Please help me out. [ICODE] #include<iostream.h> #include<conio.h> const int n=10; void main(){ int a[n] , l , initial, final, mid,data; for(l=0; l<n; l++) … | |
I got a matrix adjency that i want to transform in an adjency list and i got this error that i cant figure out... main.cpp|65|error: cannot convert 'int (*)[25]' to 'int**' for argument '1' to 'Ville** conversion(int**, Ville**, int) main.cpp|70|error: cannot convert 'int (*)[25]' to 'int**' for argument '1' to … | |
What's wrong with this code, I'm getting LNK errors [CODE]#include "Queue.h" int main() { Queue <int> q; // q is an object q.showQ(); q.insert(72); q.insert(36); q.insert(43); q.showQ(); q.remove(); q.showQ(); return 0; } [/CODE] | |
hi everyone i have to write c++ code to implement a disjoint set class to make a maze generator. i have the disjoint set class working fine. my code for the maze generator is not working.. kindly help [code] #include <iostream> #include <stdlib.h> #include <stdio.h> #include <time.h> #include "djset.h" using … | |
I am looking for a replacement for _getch(); Yes I have seen other threads like this, but they do not really satisfy my need(And I do not want to waste my time trying to write one in Assembler, as it isn't my strongpoint). I need something that is exactly like … | |
How to hide my Win32 console application to the system tray (placed as an icon). | |
iv taken a list of bakery items from user in doubly linked list.. but remove func isnt working................ :( | |
[CODE]//SOME BODY PLEASE WRITE THIS IN C++ LANGUAGE// //THANK YOU// # include<stdio.h> # include<conio.h> /*program to evaluate the given postfix expression*/ typedef struct { int a[100]; int top; } STACK; void push(STACK *s,int x) { if(s->top==99) printf("STACK OVERFLOW\n"); else s->a[++s->top]=x; } int pop(STACK *s) { int x; if(s->top<0) printf("STACK UNDERFLOW\n"); … | |
Hi, I am trying to show the french character in my application , all charaacters are comming perfect in List box and Text box but some of the characters like "Æ’" are not comming properly in Text box. My application is in VC++. | |
At first, I wrote something like this [code] template<typename T, size_t size> inline size_t const sizeof_array(T const [size]){return size;} [/code] but if failed, then I find a solution form the other place, like this. [code] template<typename T, size_t size> inline size_t const sizeof_array(T const (&)[size]){return size;} [/code] what is the … | |
I need to write a poker game that simulates a penalty kick in a soccer match. Three cards are drawn randomly. [CODE] void DrawCard(int& numberOne, int& numberTwo, int& numberThree) { RandNoGen(); //init random number generator numberOne = rand() % 13 + 1; //random number in [1, 13] do { numberTwo … | |
First of all, this is not schoolwork but rather me trying to read about c++ and through program examples and see if I can write my own. So help is much appreciated if you could as I am a new learner. This program that I am writing is supposed to … | |
Hello, I've created something, its quite large, however I decided to write it without using oop, now I believe I see why I should just use oop. Okay, so the problem is with my bool values specifically: [CODE]button_pickup2 = false; button_pickup1 = true;[/CODE] For some reason when the ReflexAgent function … | |
[CODE] class C{ friend class F; private: fct1(){} fct2(){} fct3(){} public: fct_for_everyone(){} }; class F{ }; [/CODE] F is a friend of C, so it has access to fct1,fct2,fct3. But in real life, friendship has limits! You don't want to reveal everything! So is there a way in C++ to … | |
}[CODE]#include <stdio.h> #include <string.h> struct cd_detail { char group[20]; char name[50]; int year; double price, playtime,costTotal; } cd[7]={{"Alan","Tibet sing",2008,51,600}, {"Thubasa","Fly away",2007,52,700}, {"Alan","I love China",2010,53,500}, {"pitbull","Jump to jump",2005,54,720}, {"pitbull","crazy mix",2009,48,630}, {"pitbull","Let we ROCK",2010,49,608}, {"Alan","Sakura mansume",2010,56,909}}; void main() { char group[20]; int k; printf("Enter group>"); gets (group); printf("Name \tYear \tPrice \tPlaytime\n"); printf("========\t=======\t======\t=============\n"); … | |
Hi All. I am trying to learn linked lists, and I am a little bit confused what the next pointer as well as the head pointer does. I was reading a tutorial online, and they gave this example. [CODE]#include <iostream> #include <string> using namespace std; struct Family { string nameOfFamilyMember; … | |
Within this code I would like to save the data which was input through a function "SavePlayer", but it doesn't work. The compiler "says" that object "a" ist not known. Probably the bold line [CODE][B][I]a.SavePlayer(manyPlayer,Player a); [/I][/B][/CODE]is wrong, but I have no idea how to solve the problem. Maybe someone … | |
does anyone have any note on rewriting C/C++ programs in Python?? google and bing give me the exact opposite, and I've got a headache from searching... please note that I can't read C++ if you need the program I'm rewriting, please let me know | |
I'm passing a this pointer in my constructor initialization list for use by a base class and VC9 gives me this warning about it... main.cpp(124) : warning C4355: 'this' : used in base member initializer list The program runs perfectly as compiled by VC9 Pro or Code::Blocks 10.05. In Code::Blocks … | |
In all the new IDEs when using open and close curly brackets the auto-formatting usually indents, and uses the extendable block (with the + sign) even if it is not necessary. For example, I like when all my functions have there own little extendable block but when I place them … | |
Hello Everyone My background: Civil/Structural and Mechanical Engineering. I work as a Structural Engineer designing bridges. I would like to develop a program that analyzes and design structures but do not know much about software development. I have created a library of spreadsheets that are very powerful and when working … |
The End.