49,761 Topics

Member Avatar for
Member Avatar for Black Magic

Hey, I got bored so was making this program and i know how to get the highest and lowest number but I was wondering if there was a even quicker way, or would : [CODE=C++]if( number1 > number2 && number1 > number3) highNum = number1; else if( number2 > number1 …

Member Avatar for n.aggel
0
148
Member Avatar for jesseb07

Hey, I've been trying to work with wxwidgets so I can start learning GUI's, problem is, it seems like all their libraries are full of errors. I have a hard time believing that a self-respecting group of people would release, as stable, something that would take hours, if not days, …

Member Avatar for jesseb07
0
151
Member Avatar for hapiscrap

Bloodshed dev c++, recieved 1 error on line 24 (return 0), here is the error.... Compiler: Default compiler Executing g++.exe... g++.exe "C:\Dev-Cpp\payroll.cpp" -o "C:\Dev-Cpp\payroll.exe" -g3 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3 C:\Dev-Cpp\payroll.cpp: In function `int main()': C:\Dev-Cpp\payroll.cpp:24: error: expected `;' before "return" here is input........ Execution terminated [code] #include …

Member Avatar for Salem
0
329
Member Avatar for ara_neko25

i can't think of the logic of this machine problem.. the problem statement is this.. Using loop, write a program that will ask the user to enter a character for left or right. Then, the user will enter a number. The program should generate a ladder of x wherein the …

Member Avatar for Salem
0
102
Member Avatar for EngSara

hi.... I need a c++ code that read a log ( Contains numbers and letters) file and compute the average.... This is a sample of the log file.... ********************************************************** Input vector # 99: OUTPUT: 0 1 0 1 0 **** Vdd = 1.8 **** Tclk = 0.1 **** SER(FIT): 1.1e-002 …

Member Avatar for EngSara
0
259
Member Avatar for spaceboy

Here's a program idea that I bet is kind of rare. I am working on developing my psychic abilities (seriously), and I want to write a program to assist me in determining how far my 'quick-pick' lotto tickets are straying from random chance. For example, every day I spend $1 …

0
46
Member Avatar for Kevin Baker

I have an assignment for school to make a program called the game of life. This program takes values from a data file and places them in a 2d array. All the values taked are set to true in the array and any empty places default to false. Then it …

Member Avatar for Salem
0
137
Member Avatar for Lotus_2011

Hi, Can anyone help me in this code bubble sort in c++,,, this is my code.......[CODE]void main() { int A[5]={7,2,10,15,3}; int i,j,swap; for(j=0;j<5;j++) { for(i=0;i<5;i++) { if(A[i]>A[i+1]) { swap=A[i]; A[i]=A[i+1]; A[i+1]=swap; } } } for(i=0;i<5;i++) cout<<A[i]<<endl; }[/CODE] :(

Member Avatar for Lotus_2011
0
120
Member Avatar for Cybulski

Hello everyone. Welcome to my first post. I have problem, it didn't brough me here, but maybe someone figure it out, I'm staring at this piece of code for hour. I'm trying to make directory listing class. It puts filenames and directories to vectors. It's not finished, yet not working …

Member Avatar for mitrmkar
0
348
Member Avatar for grommet2481

I know that this is a simple one but never the less I forget how to do it. How do I create white spaces on my screen. Im writting in DEV-C++. I want my output to look something like this Name title pay Sam Uni student shit I know how …

Member Avatar for grommet2481
0
88
Member Avatar for noraantonia

Hello, I have a question. I work in visual c++ in a document/view arhitecture (SDI application) and i draw some stuff with some opengl functions (cubes, cylinders) but when i hit the "New" menu from the File menu it doesn't erase or clear my drawing I don't know why. Can …

Member Avatar for noraantonia
0
88
Member Avatar for alikoli

Hello every body.............. any one can help me about this program. I want to create a simple program in C++ i want When the program runs they prompt "Enter the Names:" for example: Name1: Abc Name2: Cup Name3: Altavista Name4: Yahoo Name5: Mbni Name6: Sun Name7: Mani Name8: Google Name9: …

Member Avatar for scarface3288
0
786
Member Avatar for monstro

Aside from access specifiers (private, public, protected), what differentiates structures and unions from classes in C++? I have been told that in C++, classes and their associated components are instantiated in memory in pretty much random order, but structs and unions are instantiated in a fixed order? Is this true? …

Member Avatar for Duoas
0
180
Member Avatar for megatr0n

okay so I'm not sure how to do this, but suppose i have a struct that looks something like this: struct soundNode{ string identifier; sound new_sound; soundNode* next; soundNode* prev; }; sound is an object that is defined by a .h file. and in my main program, i have a …

Member Avatar for VernonDozier
0
75
Member Avatar for kashi_787

I want to read file in binary mode using fread() into structure members. following is the code which works perfectly on Turbo C compiler(DOS base) but doesn't work for VC++ 6, it is giving exception at fread() statement. The input to this file we can give any .bmp file name …

Member Avatar for jephthah
0
140
Member Avatar for putagunta

Hi, I am debugging with gdb a huge program on HP-UX. It has a very strange behaviour and I could not identify the cause. Have a look at this for example: (gdb) c Continuing. Breakpoint 2, CExtract::extractDAT (this=0x80000001007bb9d8, user=@0x80000001004d4670) at Extract.cpp:1761 1761 meas.getSumMethodName ( sCol.meas_sum_method_name ); (gdb) p &meas $9 …

Member Avatar for putagunta
0
82
Member Avatar for noraantonia

Hello, I have a question. I work in visual c++ in a document/view arhitecture (SDI application) and i draw some stuff with some opengl functions (cubes, cylinders) but when i hit the "New" menu from the File menu it doesn't erase or clear my drawing :( I don't know why. …

Member Avatar for mitrmkar
0
188
Member Avatar for Jennifer84

I am reading a file that is about 20 Mb, this will take about 10 seconds. A few lines from this file look like below. The first value is a date value that go from lower to higher and the second value after the "Comma" is a number. In the …

Member Avatar for Jennifer84
0
575
Member Avatar for CoolGamer48

hey, is this code: [CODE=C++]if(m_velocity.x == 0) return 0; return ToDegrees(atan(m_velocity.y/m_velocity.x));[/CODE] any more efficient than this code: [CODE] if(m_velocity.x == 0) return 0; else return ToDegrees(atan(m_velocity.y/m_velocity.x));[/CODE] I.e., are we saving any time by omitting the else statement?

Member Avatar for Salem
0
143
Member Avatar for Aamit

In Xp... I want to access start->run through programatically like when click start ->run-> //192.168.23.5 how i access this run through c???

Member Avatar for marco93
0
191
Member Avatar for picass0

my string contain "hello baby" and i wanted to find the position of the character 'l' which falls in pos 2 and 3. Using string.find("l") return me the position of first "l" found. How can i do a loop to find the position of my next character 'l' in the …

Member Avatar for Radical Edward
0
75
Member Avatar for picass0

How can i cut out every 4 characters from a text file? Example: my text file rows of binary numbers like: 101010101000010101010111 i wanted to cut out every 4 characters from it becomes: 1010 1010 1000 0101 .... .... ..... i have been bale to cut out the 4 characters …

Member Avatar for Radical Edward
0
91
Member Avatar for Zavani Nixon

Hi, I just bought a hp laptop installed with Vista business and I hava installed in it Microsoft Visual C++ 6.0. Initially, I was able to write programs with it but it could not execute the programs. Now, I am even faced with a bigger problem, it cannot open a …

Member Avatar for Ancient Dragon
0
230
Member Avatar for Black Magic

Hey, I made i looked up toupper and made a little program out of it and have come to a little situation, When i enter the space character " " it does not output what i want and it just closes. [CODE=C++]#include <iostream> using namespace std; int main() { int …

Member Avatar for joshmo
0
154
Member Avatar for jagatsastry

Hi people. I was just wondering if I can use _LINE_( by including some header file or so) in devc++ to get the source code line number or _TIMESTAMP_ to get the compile time timestamp. If not is there an alternative? I see compile time errors when I use them …

Member Avatar for jagatsastry
0
212
Member Avatar for kako13

Hi, I'm trying to update a file with an information in a binary tree. However my algorithm is working only for one NODE. Any suggestion will be appreciated! [CODE]void Arbol::updateFile() { Nodeptr p = miArbol; // myTree Recorrer(p); cout << "File updated!" << endl; cout << endl; } void Arbol::Recorrer(Nodeptr …

Member Avatar for kako13
0
146
Member Avatar for guest7

Hi, I wish to delete the first 3 lines from a file. Following is my code which goes into an infifnte loop. [code=cplusplus] int main() { vector<string> text_file; fstream fout; int count = 1; fout.open("tempfile.txt"); assert(!fout.fail()); string temp; while(!fout.eof()) { if(count <= 3) { getline(fout,temp); count++; } if(count > 3) …

Member Avatar for Ancient Dragon
0
108
Member Avatar for shadowfire36

i got my code to finally compile but, now im getting 5 linker errors that i have no idea why im throwing them the errors are: [code=cpp] football.obj : error LNK2019: unresolved external symbol "public: void __thiscall Football::SearchMatches(struct Match * * const,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int)" (?SearchMatches@Football@@QAEXQAPAUMatch@@HV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function …

Member Avatar for Ancient Dragon
0
154
Member Avatar for salman1354

Hi All, Quick question... I have a structure for a specific type of vector: struct SParticle { float Position; float Velocity; float FcnVal; float LocalBest; float LocalBestVal; } But now I need to define 30 objects for this structure. Is there an easy way for doing this or should I …

Member Avatar for salman1354
0
104
Member Avatar for Metalsiege

Hey everyone. I've been working on a homework assignment to simulate a weather station responsible for recording hourly temps and reporting an average temp. I'm supposed to be passing an array to different functions to first get the temps and input them into the array. Then, compute the average temp …

Member Avatar for Metalsiege
0
200

The End.