49,757 Topics

Member Avatar for
Member Avatar for Kunal Aggarwal

I am Creating a MFC Application to Read a Text file into a Edit Box. I am implementing the following code [CODE] FILE *m_pFile ; CString m_strLine , m_strText; char line [1000] = "" ; m_pFile = fopen ( "C:\\SELF.txt" , "r" ) ; if ( m_pFile != NULL ) …

Member Avatar for Kunal Aggarwal
0
195
Member Avatar for Nathaniel10

I am trying to do an exercise in Stroustrup's book. The task is to create two arrays (with different values) and pointers to each array, and copy the first array to the second using the pointer and reference operators. My code is below. [code] #include "../../std_lib_facilities.h" int main () { …

Member Avatar for Nathaniel10
0
73
Member Avatar for clarencehwang

How to I call a C++ function from my C# class with the following signature? [code=c] int MyFunc(MyStructure **) typedef struct MyStructure { unsigned char ID[16]; unsigned int* Path; AnotherStructure *Format; } typedef struct AnotherStructure { short Owner; short Type; } [/code] I attempted the following in C#... [code] public …

Member Avatar for kvprajapati
0
184
Member Avatar for tln26

I am trying to get the numbers in the array to give me a average out put. here is what I have so for: [COLOR=#0000ff][/COLOR] [CODE] #include "stdafx.h" #include <iostream> #include <cctype> using std::cout; using std::cin; using std::endl; int main() { int grade[10]; int count = 0; char reply = …

Member Avatar for hits86
0
376
Member Avatar for ktsangop

Hi everyone. I have an MFC project in Visual C++ 6 and was wondering in which way can i detect the level of audio output. I want to execute some code only when no sound is sent to the audio output. Could anyone please give me a clue of how …

Member Avatar for ktsangop
0
161
Member Avatar for burcin erek

Pls check the code. for example during betting if you write "One" if the dice comes 1, you win. but when you write one it writes 2.28 1026 why. I dont want case sensitive and it would be perfect if the first and second character I write for input, it …

Member Avatar for burcin erek
0
143
Member Avatar for The physicist

Hi all, I'm trying to convert a console application that I wrote in Codeblocks to a Windows Form application written in Visual Studio .NET 2003. I'm having trouble converting a piece of code that reads in a formatted text file line by line (the text in the file is always …

Member Avatar for jonsca
0
189
Member Avatar for LloYdZ

The registrar of your school needs a program that can be used to prepare grade reports for students at the end of each semester. For each student, the program should display a table showing each course taken during the semester and the grade and credits for that course. The program …

Member Avatar for EarendurRingern
0
153
Member Avatar for theausum
Member Avatar for theausum
0
116
Member Avatar for dspjm

I want to read some books about data structure written in c++, can anybody recommend some good books for me?Thx.

Member Avatar for dspjm
0
119
Member Avatar for Ptap03

Hello, First I would like to say thank you for looking and any help will be greatly appreciated. I am trying to write a code which does the following: 1) Read a file (The file contains list of words) 2) The purpose of the program to ask the user to …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for aaronmk2

I an trying to find the height in a binary search tree. I figured out how to count the leaves going directly left and directly right, but cannot figure out how to get he leaves in the middle. [CODE] int BST::height(){ int tall =0; int tall1=0; BinNodePtr ptr=myRoot; if (ptr->left …

Member Avatar for mrnutty
0
181
Member Avatar for tdnghia89

Hi all, I have the following problem: My server sends the string str="1 2 4 dds \n" continuously to a C++ client.Here is the java code of the server: [CODE] private class SendingThread implements Runnable{ public Socket s; public DataOutputStream oo; public ObjectInputStream oi; ////private QueryTransferObject q; boolean connected; public …

0
74
Member Avatar for centerline00

Why is it, when I compile this, the cout statement runs twice at first? It does not do that when I have the rest of the code in there that is int. Any thoughts of why or what I am doing wrong.. #include <iostream> #include <string> using namespace std; int …

Member Avatar for gerard4143
0
128
Member Avatar for UZU309

Hello all, I am trying to figure out how to make my program do the following(it's a table): The user enters a beginning amount and interest rate. The year, beginning amount, interest and end amount are all supposed to keep increasing until the end amount is doubled of the beginning …

0
64
Member Avatar for watery87

Hi guys, this program is suppose to ask user input for up to 10 book titles and date published using classes. However im having trouble with a certain part of the output. My coding as follows [code] #include <iostream> #include <string> #include <sstream> using namespace std; class bookInput { private: …

Member Avatar for Unimportant
0
186
Member Avatar for Anuradha Mandal
Member Avatar for daviddoria
0
212
Member Avatar for Nathaniel10

I am trying to do an exercise from Stroustup's book. The task is to create an array of 7 ints, assign its address to another variable, then print out the array value and the address. My code is below. [code] int main () { int p0[7] = {0, 0, 0, …

Member Avatar for Nathaniel10
0
84
Member Avatar for bonucci

Hi guys, nice being a part of this community, sorry for my english if some sentences doesnt make much sense. Well, my question is i have a file, i liked to make a script that for example, in 1 or 2 hours would get the txt file where its located …

Member Avatar for Unimportant
0
101
Member Avatar for athar89

Hi guys, can anyone suggest an alternative method to splitting an integer into separate digits besides using the modulus"%" and division"/" technique or using itoa() or such functions to covert it to a string and then split it. i want to do it without the aid of STL or any …

Member Avatar for mrnutty
0
437
Member Avatar for Urv73

Hi there!! I have a simple program (I'm a newbie) that inputs data for different people. For instance: [B][COLOR="Green"]Employee nr? 122 Nr of years in company? 2 Employee nr? 29 Nr of years in company? 5[/COLOR][/B] The thing I wanna ask is for a simple way to se a output …

Member Avatar for Unimportant
0
74
Member Avatar for usshadowop

Having trouble implementing my own reserve function. ( have to do it for an assignment) Here is what i have so far but it doesn't appear to work. .h prototype [code=c++] void reserve(size_type n);[/code] constructor for our string [code=c++] mystring::mystring(const char * s) { len = strlen(s); buf_size = len …

Member Avatar for Unimportant
0
142
Member Avatar for kra9853

I need help rewriting my if-else statements into a switch statement, [CODE]//equations for final grade LGT=(LG1+LG2+LG3+LG4)/40.*.40*100; MTPG=MTP*.4; MTEG=(MTE/55.)*.20*100; sum=LGT+MTPG+MTEG; if(sum>95) //if-else statements, determines final grade letter='A'; else if(sum>85) letter='B'; else if(sum>75) letter='C'; else if(sum>65) letter='D'; else letter='F'; cout<<"final grade is: "<<letter<<endl;[/CODE] also i need to somehow get my switch statement …

Member Avatar for Unimportant
0
237
Member Avatar for kra9853

How do use the pow function with variables? i.e. [CODE]//equations for problem 9 page 99 part b cT=(hT)/2; iT=(base*(hT*hT*hT))/12; LT=(sT*iT)/(8*cT);[/CODE] *math.h file in program how would i raise "hT" to the 3 power in correct c++ syntax?

Member Avatar for jonsca
0
77
Member Avatar for ginn69

write a program which prompts the user to enter an integer whose value is more than 3. Based on inputed number, the program outputs a rectanglar textual shape using digits.(see below). sample run enter n: 5 ***** * * * * * * ***** can explain detail like write down …

Member Avatar for jonsca
0
71
Member Avatar for mybluehair

I've got a c++ game I'm working on, and I need it to play some music in the background while the user is playing. I looked up how to use PlaySound() and put it in my program. The .wav file loads and plays perfectly, but at the same time, doesn't …

Member Avatar for Unimportant
0
168
Member Avatar for pstrohma

I'm using VC++ 10.0 Express to create an app that will find all visible drives (C:, USB drives, Memory Sticks, Lettered network drives, etc.) and populate a checked list box with those available drive letters. The app currently is loading the prefab list of A: through Z:, with the eventual …

Member Avatar for pstrohma
0
514
Member Avatar for +_+man
Member Avatar for EarendurRingern

im making a program that loads a collection of strings from a file. then the user need to search the keyword using a binarysearch, but im using strings in my program, how to make the program using array of characters? here's my code, thx before :) [code] #include <iostream> #include …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for NoMoreKawasaki

i have to do with my new assignment but the problem is not im don't try to do it at all i've tried it before..the question is to write a c++ program about ask the user an input of a range of numbers.by using the rand() an output of three …

Member Avatar for Unimportant
0
92

The End.