49,757 Topics

Member Avatar for
Member Avatar for cokaznsyco72

here's a function I tried to write that reverses the order of a c-string [code=cplusplus] void reverse(char *wordPtr) { char revWord[SIZE]; int count = 0, // index counter newSize = 0; // to count word size while (wordPtr[count] != '\0') { newSize += 1; count++; } cout << "The size …

Member Avatar for cokaznsyco72
0
182
Member Avatar for 143wena

hi im new in this site and i have a problem on making a c++ program.. i can't understand it well.. can someone help me please.. im willing to understand on what will u teach on me..

Member Avatar for Nick Evan
0
157
Member Avatar for goody11

Ok, I've tried literally over 100 things and still can't figure this out. I want to add strings that I've loaded from a text file to a list box. Here is my coding: [code=cplusplus] vector<string> spnV; //this is a global variable BOOL LoadTextFileToEdit(LPCTSTR pszFileName) { ifstream inStream(pszFileName); if(!(inStream.is_open())) { MessageBox(NULL, …

Member Avatar for goody11
0
678
Member Avatar for TheSilverFox

Hello all! I am typing in some code from an example in my book, but it shows the absolute value symbol, I believe, looking similar to " l l ", but it can't be just to lower case Ls spaced apart like I just made that...or is it? If not, …

Member Avatar for TheSilverFox
0
102
Member Avatar for vedybird

i face a problem, im doing a programing that program into the PIC16F684. im doing a digital clock, now i only able to show the second value that display 1 to 60, i dont know how to do the minute value. im using while loop. [code=c] while(1 == 1) { …

Member Avatar for mrnutty
0
126
Member Avatar for madmath

I am new here and this is my first post. I have a question that I can't find on google. I'd be grateful if you could help me. I have written many programs dealing with arrays and wanted to know how can I validate an input. Say I have the …

Member Avatar for mrnutty
0
3K
Member Avatar for kylelyk

I am using dev-c++ with allegro here is the code: [code=cplusplus]#include <allegro.h> int SCREEN_WIDTH; int SCREEN_HEIGHT; BITMAP *buffer; int main(int argc, char *argv[]){ allegro_init(); install_mouse(); SCREEN_WIDTH = 620; SCREEN_HEIGHT = 240; set_color_depth(16); set_gfx_mode( GFX_AUTODETECT_WINDOWED, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); show_mouse(screen); buffer = create_bitmap(SCREEN_WIDTH, SCREEN_HEIGHT); putpixel(buffer,300,300,4); blit(buffer,screen,0,0,0,0,SCREEN_WIDTH,SCREEN_HEIGHT); while(!key[KEY_ESC]){ //do stuff clear_keybuf(); } …

Member Avatar for mrnutty
0
111
Member Avatar for qkslvr1621

here is what i have so far, it compiles and runs great except for the fact that when i enter 'n' it doesn't stop the loop, any help is greatly appreciated! [CODE]/* Write a program that prompts the user for two numbers – the dividend and the divisor – and …

Member Avatar for mrnutty
0
110
Member Avatar for lancevo3

I am working with traversals for the first time and am running into some errors with my them I am just going to post my preorder code because I am gettin the same error for post and in order. The Error: BSTree.h: In member function âvoid BSTree<T>::printPreorder() const [with T …

Member Avatar for lancevo3
0
107
Member Avatar for bharatsinh

please provide me codes how to construct circular matrix as below 1 2 3 4 12 13 14 5 11 16 15 6 10 9 8 7

Member Avatar for mrnutty
0
140
Member Avatar for valmiki

How do i print the following number pattern(Triangular pattern) ............1 .........1 2 1 ......1 2 3 2 1 ...1 2 3 4 3 2 1 1 2 3 4 5 4 3 2 1

Member Avatar for mrnutty
0
91
Member Avatar for kylelyk

here is the simple code: [code=cplusplus]#include <allegro.h> #include <iostream> using namespace std; int FindArea(int,int); int main(){ int lenghtOfYard; int widthOfYard; int areaOfYard; cout << "\nHow wide is your yard? "; cin >> widthOfYard; cout << "\nHow lond is your yard? "; cin >> lenghtOfYard; areaOfYard= FindArea(lenghtOfYard,widthOfYard); cout << "\nYour yard …

Member Avatar for kylelyk
0
163
Member Avatar for Aphrodite

Hi all, When the user enters a word, isKnownWord() checks whether the word is in the dictionary but even when I enter a word which I know is in the dictionary, into the terminal, it always outputs no! Can somebody please explain why it is doing this? isKnownWord in sc …

Member Avatar for mvmalderen
0
146
Member Avatar for mandofl

Hello people. I have a favor to ask. My programming challenge is to write a program that uses a structure named movie data to store the following, title, director, year released, running time. this program should create two moviedata variables store values in their members, and pass each one in …

Member Avatar for mandofl
1
7K
Member Avatar for Silvershaft

I think I master the basics of C++ that good I can move, not all though there are many things still I don't know of course. I've made applications with mysql and made my own little roleplaying game and some calculator like things. Basically noobie like programs with no graphics …

Member Avatar for Dave Sinkula
0
89
Member Avatar for amegahed3

Hi All, I'm a beginner in C and C++, and I get a "Stack Overflow" problem when I compile my code. I use visual studio 2008. My code uses some library, that has some header files, and some .cpp files. The library basically helps me in getting a random number …

Member Avatar for Dave Sinkula
0
148
Member Avatar for funjoke88

1. Write a C program to read a list of books from a file and create a linked list to store them. The purpose of this program is to keep track of the books kept in a shelf. The shelf is a three-tier shelf and each tier can store up …

Member Avatar for chili5
-1
147
Member Avatar for dumrat

Hi, I was assigned to study and understand some code and I was told the major problem with the program was poor performance. Here's the bottleneck: A global data set is maintained. This data set is updated regularly. Then there are threads that have to do some processing using a …

Member Avatar for Salem
0
98
Member Avatar for huzeifa

Hi everyone, please can anyone show me how to show a progress bar while copying a file. I tried using SetTimer() but i does not work the way i want it i.e the file gets copied after the given time has finished.

Member Avatar for Ancient Dragon
0
105
Member Avatar for Aphrodite

Hi all, can you please help me solve these errors I am receiving: q2.cpp:127: error: expected primary-expression before ‘*’ token q2.cpp:127: error: ‘wordPointer’ was not declared in this scope print function which is contained within the sc class: [code] void printDict(struct wordRecord *wordPointer) { // Code omitted to step through …

Member Avatar for Aphrodite
0
97
Member Avatar for slatk3y

Hello, I have a question about bitwise operators, especially shifting. Suppose we have: [code=C++] #include <iostream> using namespace std; int main() { unsigned i = 2; i<<=2; cout << i << endl; } [/code] unsigned i = 2 in binary is 0.......00010, if we shift 2 bits to the left …

Member Avatar for slatk3y
0
132
Member Avatar for Shaitan00

I'm having an odd problem writing some template classes and placing the implementation in a separate .CPP file - specifically I keep getting the following errors: Error 1 error C2143: syntax error : missing ';' before 'List<T>::begin' Error 2 error C4430: missing type specifier - int assumed. Note: C++ does …

Member Avatar for Tom Gunn
0
335
Member Avatar for hashinclude

hello , first i want to say that im very new at c++ , i managed to create a very simple program through searching the internet , this little program involves running a certain exe file with parameters : (e.g: "c:\folder\file.exe" -parameter1 -parameter2) i am using the system() function to …

Member Avatar for epitalon
0
181
Member Avatar for shazzy99

Hi, I've been trying to read the file content from the file path entered by user at run time. However i always end up in error. Help needed... char name[100]; ifstream infile; cout<<"Enter filename to open"; cin.getline(name,100); infile.open(name); if(!(infile.is_open())) { cout<<endl<<"File Not Found"; } i'm not using relative path, instead …

Member Avatar for shazzy99
0
176
Member Avatar for xiikryssiix

okay, i wouldnt be asking for help if i didnt need. im completely stuck and have no idea HOW to fix it. my teacher didnt really teach how to figure out these things, he basically left the last assignment as a "teach ourselves" moment. anyway...whole point of the assignment is …

Member Avatar for cgeier
0
104
Member Avatar for J@ckel

there is something i want to ask about this [code] LPDIRECT3D9 pdirectX9; [/code] I understand this is a pointer but why do we not use the * like this [code] LPDIRECT3D9 *pdirectX9; [/code] when i look over my code it confuses me with a struct EDIT: doing some reading into …

Member Avatar for thelamb
0
142
Member Avatar for Pamella

guys i'm asking for some help..i have an asgnment bout c++..our prof ask us to give 2 examples ech of the simple if prog, if else, if else if, switch, while, do while and for loop...tnx i'm just a freshmen student of bsit..tnx =)

Member Avatar for Pamella
0
94
Member Avatar for harryhaaren

Hi everyone, Im working on a large scale audio program, and I got a question regarding namespaces: The main() part of the program includes my own headers, each named according to what part it plays in the program, eg: Audio.hpp , Midi.hpp etc. These headers will "load" other headers..? Is …

Member Avatar for kvprajapati
0
119
Member Avatar for kylelyk

I have this example file that I've been using to get used to the perks of Allegro, but the file is written in an earlier version of Allegro than 4.2.2. There are only a few errors, but I don't know how to fix them! I'll post the code and the …

Member Avatar for kylelyk
0
236
Member Avatar for nschessnerd

Hey, I've been stuck on this for a long time now and ive tried various things... i need to send multiple packets to a server for an infinite amount of time at an unknown rate, maybe 1 packet every 30 minutes, tor a few every 5 minutes... id like to …

0
47

The End.