49,766 Topics

Member Avatar for
Member Avatar for byrosport

[CODE]// name-printer.cpp : Defines the entry point for the console application. // #include <stdlib.h> #include <iostream> #include <iomanip> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main () { string inputNameString; //the Name string that is entered by the user string names[3]; // A string array that will …

Member Avatar for WaltP
0
198
Member Avatar for ztdep

Dear friends: I get different resutls when copy my code from windows to linux system. the string comparion " if( keyword==Key[0] ) " is true in window system, but it is false in linux system. I am really confused about this.I copy the same source code and the same input …

Member Avatar for mrnutty
0
241
Member Avatar for sha11e

I found a page saying that int a = 12; and int a (12); do the same thing. But is there something special with the int a (12); way of initializing a variables? Like, you can do: string test(5, '-'); which would make test = ----- I couldn't seem to …

Member Avatar for Narue
0
101
Member Avatar for murnesty

let say i have a class A (base) class B , C, D also inherit A [ multiple ] then class E inherit class B, C, D... But class E also want to inherit class A [ multilevel ] *I want to use class A protected function in class E... …

Member Avatar for Ancient Dragon
0
121
Member Avatar for Rizi004

Hi ever one i make a function that print the reverse integer e.g if we input 12345 it print 54321 but the problem is that when i use return b; it print 5 4 3 2 1 1 and when remove return b; then it prints 5 4 3 2 …

Member Avatar for Rizi004
0
168
Member Avatar for fsefsef23

I'm reading from a file into an array of objects i created called Team. The file is written in this format: Shane Vitorino CF 8 8 H H H B B O O K Ben Francisco ....... The first line is the player's name, the second line is his position, …

Member Avatar for fsefsef23
0
249
Member Avatar for deliezer

Hi, I am writing an application in which I make a map of strategies keyed by a string symbol. In order to construct the strategies I pass the constructor a filename, out of which it reads out some data, into an initializing map. It is possible that some data might …

Member Avatar for deliezer
0
328
Member Avatar for Celtrix

What to code? post useful things that you do repetitively on a daily basis(must be non Windows or Mac ) specific that you would like automated but don't have the time to code?(as my machine is too slow to run windows or mac sorry :( )

Member Avatar for Celtrix
0
109
Member Avatar for sha11e

OK....sigh... I need to link to lwinmm to use playsound and stuff Looked around and looked like I needed to do it like this: I'm using Codeblocks [CODE] #include <iostream> #include<windows.h> #include <mmsystem.h> #pragma comment (lib, "winmm.lib") using namespace std; int main() { PlaySound((LPCWSTR) "c:\\Snap ya fingers.wav", NULL, SND_FILENAME | …

Member Avatar for saeedmmmm
0
5K
Member Avatar for Riaz Haider

hey guys... i wanted to know how to make multiple conditions such that each condition has arange of values...i have written the following code but doesnt work help me quick plz. It is aPIC program for monitoring the ADC value and sending to LCD [CODE]if(ADRESL==0x00) {lcddata('O'); DELAY(2); lcddata('F'); DELAY(2); lcddata('F'); …

Member Avatar for Riaz Haider
0
314
Member Avatar for milan2011

Hi, I am trying to read two strings per line and store them in strings so i can use them in my program.for example if this is my input file: [CODE]cat:yellow dog:blue chicken:red[/CODE] i wan to store cat as animal1 string dog as animal2 string and yellow as colour1 string …

Member Avatar for Lyandor
0
170
Member Avatar for clickspiker23

Im trying to output the population increase for a population. the problem is my for loop doesn't increment or add correctly. here is a sample output. i made it easy with no death rate and a population of 100 to easily calculate the increase in my head. Starting Population: 100 …

Member Avatar for m4ster_r0shi
0
136
Member Avatar for Syrne

So I'm fairly new to C++ and I'm wondering if this would be possible and what the code would look like. I'm trying to create an ongoing process that monitors when a certain program does something and launches another program when that thing happens. Example: I have Steam open and …

Member Avatar for Ancient Dragon
0
327
Member Avatar for sha11e

[CODE] #include <iostream> using namespace std; void someFunction(bool& a); int main() { bool a = true; someFunction(a); if( a ) cout <<"a = true"; else cout <<"a = false"; } void someFunction(bool& a) { a = false; } [/CODE] This will print out "a = false". bool& a in the …

Member Avatar for pseudorandom21
0
271
Member Avatar for munitjsr2

PLease help me with these questions, I was interviewed for thses just today Q1)Can we delare constant data members inside a class? Q2)does friend function violates encapsulation/data hiding? Q3)what are the types of polymorhphism you know? Q4)why do you need virtual functions? Q5)Can we do something like\ int & = …

Member Avatar for kanuxy
-2
185
Member Avatar for yobbko

I have .xls or .xlxs and there I have Bar with number and text.... I want to use number and text form this file.... e.g. boys in class (cell on form) 24 (other cell on form)

Member Avatar for Tellalca
0
125
Member Avatar for MoNaLiZaOman

[B]Hello all I am a student majoring in Beginner Software ENGINEERING I do not have much experience in game development n has asked us to develop a game I hope 2 to get some help here even sources that need to extend it And thank you all[/B]

Member Avatar for Tellalca
0
98
Member Avatar for jack1234

I am using visual C++ 2005(native C++) I got the error error C2065: 'CString' : undeclared identifier for the following code, [CODE]#include <cstring> using namespace std; int main(){ CString ab; ab="a"; }[/CODE] what is the problem?

Member Avatar for Yellaiah
0
10K
Member Avatar for marcux

Hi all! I have been hacking some Qt before, but now I want to try to code in Gtk and std C++. I have been searching the web but I can not realy find what I am looking for. As I can see Gtk is written in C. Is it …

Member Avatar for GreenDay2001
0
225
Member Avatar for u8sand

I programmed this vector class to support different types and different amount of dimensions. (class T,int D) D is the dimension. I don't use templates much and I'm running into an error, my constructors aren't working. Here is my class [CODE]#include <stdio.h> #include <stdarg.h> template <class T,int D> class Vector …

Member Avatar for mike_2000_17
0
247
Member Avatar for senergy
Member Avatar for ktsangop
0
143
Member Avatar for ktsangop

Hi everyone! I am using a dll to hook keyboard strokes for my application. The hook works fine, but now i want to disable some keystrokes while my application is running. So i did the following : [CODE]_declspec(dllexport) LRESULT CALLBACK KBHookProc(int Code, WPARAM wParam, LPARAM lParam) { if (Code < …

Member Avatar for ktsangop
0
1K
Member Avatar for jadzrev13

Hi, I am making an student registration program as my project in school. But I had some problems making it. Our professor asked us to make an program where there are lists of subjects offered. Then the student will choose what subject/subjects he/she likes, then it will be computed. The …

Member Avatar for jadzrev13
0
3K
Member Avatar for Riteman

I created a small c++ program. Now i wanted it to create an .exe file. Once i compile, i get the exe file in my BIN folder.. but, the alignment of the files are not correct. Well i do get the correct alignment in turbo c++ compiling..(ctrl + f9).. but …

Member Avatar for thecoolman5
0
175
Member Avatar for thecoolman5

hi, i am writing a program that keeps track of the money in my debit card account. i need the program to be able to pull out a value (such as 1.56356) from a text file, round it to the nearest hundredth, and put it back into the file. any …

Member Avatar for m4ster_r0shi
0
466
Member Avatar for busty043

anyone can you help me to my C++ i cant take the error everytime i make a program i got error and can you give me a program that can solve the area of Circle In Turbo C. thanks

Member Avatar for Narue
-2
143
Member Avatar for rayden150

I made several functions, and this one assignment keeps giving me "expected primary expression before '..., HELP!", what is a primary expression?, all my code is ok I have made different files for the different functions and im using extern but the void argument I think keeps giving me trouble …

Member Avatar for Moschops
0
963
Member Avatar for gujinni

thus iterators predefined functions? I am confuse between function and predefined functions.

Member Avatar for gujinni
0
104
Member Avatar for winecoding
Member Avatar for tubby123

Hey, i found quite a few methods to [B]ADD TWO NUMBERS WITHOUT USING THE + OPERATOR[/B] , but this one is extremely weird. What does this printf statement mean ? What is %*d ????? [CODE]#include< iostream > using namespace std; int main() { int a,b,sum; scanf("%d",&a); scanf("%d",&b); sum=printf("%*d%*d",a,a,b,b); printf("\n"); printf("%d\n",sum); …

Member Avatar for tubby123
0
164

The End.