49,761 Topics

Member Avatar for
Member Avatar for HungMob

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 …

Member Avatar for NetJunkie
0
5K
Member Avatar for scobi

[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) { …

Member Avatar for scobi
0
165
Member Avatar for blt007

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 …

Member Avatar for blt007
0
624
Member Avatar for Ich bin würdig

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]

Member Avatar for Narue
0
104
Member Avatar for Tom_Weston

[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 …

Member Avatar for Tom_Weston
0
174
Member Avatar for fesago90

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)?

Member Avatar for seanwalsh1984
0
542
Member Avatar for trejorchest

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, …

Member Avatar for trejorchest
0
223
Member Avatar for wannas

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??

Member Avatar for wannas
0
3K
Member Avatar for davidhk35

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. …

Member Avatar for davidhk35
0
143
Member Avatar for mukulbudania

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....

Member Avatar for ravenous
0
110
Member Avatar for skylinedrifter

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) { …

Member Avatar for ravenous
0
1K
Member Avatar for aero31aero

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; …

Member Avatar for aero31aero
0
193
Member Avatar for skylinedrifter

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 …

Member Avatar for brainfo
0
140
Member Avatar for Obelisk4

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, …

Member Avatar for Greywolf333
0
970
Member Avatar for brainfo

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++) …

Member Avatar for brainfo
0
130
Member Avatar for inspek

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 …

Member Avatar for inspek
0
171
Member Avatar for Cross213

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]

Member Avatar for Cross213
0
150
Member Avatar for nousername19

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 …

Member Avatar for WaltP
0
415
Member Avatar for BCBTP

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 …

Member Avatar for BCBTP
0
501
Member Avatar for Tom_Weston

How to hide my Win32 console application to the system tray (placed as an icon).

Member Avatar for Taywin
0
91
Member Avatar for sunn shine

iv taken a list of bakery items from user in doubly linked list.. but remove func isnt working................ :(

Member Avatar for Taywin
0
293
Member Avatar for ayeshashahid

[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"); …

Member Avatar for ayeshashahid
0
193
Member Avatar for abhitech

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++.

Member Avatar for Ancient Dragon
0
34
Member Avatar for stereomatching

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 …

Member Avatar for vijayan121
0
179
Member Avatar for Vermouth

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 …

Member Avatar for WaltP
0
357
Member Avatar for plang007

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 …

Member Avatar for plang007
0
533
Member Avatar for rcmango

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 …

Member Avatar for gerard4143
0
316
Member Avatar for trantran

[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 …

Member Avatar for mike_2000_17
0
157
Member Avatar for Thomas Tong

}[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"); …

Member Avatar for vidit_X
0
233
Member Avatar for guccimane

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; …

Member Avatar for vidit_X
0
102

The End.