49,757 Topics
| |
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 … | |
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 … | |
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 … | |
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] :( | |
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 … | |
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 … | |
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 … | |
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: … | |
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? … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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? | |
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??? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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) … | |
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 … | |
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 … | |
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 … | |
I am working on porting C++ code to Delphi and I am only having a problem with the correct conversion of memmove() statements in the C++ code. If you or any one you know could help me to convert this C++ code to Delphi I would be thankful. // Move … | |
Write a C++ program that prints the attendance sheet of students in a class ordered by either their names or by their ID’s. The instructor will enter the number of students in the class; the students’ names [First Last] and their ID’s which will be entered as integers, and then … | |
Given all that I hear about the problems with global variables, is it possible to declare a windows CRITICAL_SECTION object as a member of a base class that will not be created for each derived class? I want to implement an instance counter that is threadsafe, so I thought about … | |
[code=cplusplus] //I have a problem, i trying to get the total prime numbers for each row on the output. //I jus getting the total prime numbers from the firs line 1 to 100 // my task is to get the total prime number from 1 to 100, 1001 to 2000.....49001 … |
The End.