49,761 Topics
| |
Hello, I'm a Freshman in college that's going to majoring in Electrical and Computer Engineering. Right now I'm taking a C++ class and I'm looking to do something funny to a friend of mine. I have been searching the web for some "fake viruses" and whatnot to to play around … | |
[CODE] #include <windows.h> #include <gl/gl.h> #include <gl/glu.h> #include <glut.h> #include <stdio.h> void drawCube(); float vertices [8][3]; int facets [6][4]; void read_file (char **argv); void init(void) { glClearColor (0.0, 0.0, 0.0, 0.0); glShadeModel (GL_FLAT); } void display(void) { glClear(GL_COLOR_BUFFER_BIT); drawCube(); glEnd(); glFlush(); glutSwapBuffers(); } void reshape (int w, int h) { … | |
Ive been having trouble solving this please help, yea its hw but im using this as a last resort as its due in 2 hours. [CODE] // Search a dictionary file for the word input by the user. // //////////////////////////////////////… #include<iostream> #include<string> #include<fstream> using namespace std; int main() { string … | |
Can someone tell me what's wrong with my syntax.. THanks [CODE] #include<stdio.h> #include<conio.h> void FACTORIAL(int factorial=1, int N) {int y; {for(y==1;y<=N;y++) factorial=factorial*y; printf("The factorial of %d is %d", N,factorial);} } void main() {clrscr(); printf("Please enter a no."); scanf("%d",&N); FACTORIAL(factorial=1,N); getch(); } [/CODE] | |
[CODE]#include <iostream> #include <windows.h> #include <string> using namespace std; void main() { string run; cin >> run; ShellExecute(NULL, NULL, run /*<<<the error*/, NULL, NULL, SW_SHOWNORMAL); }[/CODE] I want it so if i enter a file path, it open. If i replace run with "E:/test.exe", it works... but i want it … | |
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; … |
The End.