49,761 Topics
| |
Hi Everybody, If someone could help me with this problem, I would really appreciate it. I'm a newbie and trying to finish an assignment. I've gotten stuck on one thing and can't seem to find a way out of it. I've already done the searches and spent at least 5-6 … | |
Unfortunately in c++, there is really no good way go locate lines in your file without reading the entire file 'character at a time.' So, if you [I]have[/I] to read only a single line from a file, we know we are at some point going to have to be inefficient... … | |
Old fart here, still a horrible newbie. Tonight, I've actually got a working solution for my problem, but the book I'm reading is unclear about something, and I'm having trouble getting Google to give me the the exact answer I want. Given, [CODE]//Header junk //CandyBar struct int main() { CandyBar … | |
Essentially what I'm trying do with nested statements is that when I enter the the second switch stament and when I exit the second switch statement it goes back to the first switch statement menu. Currently the current code exits the entire program after the second switch exits, which of … | |
Hi all, i tried to encrypt and decrypt the files, that was successful,, but i wanted to reduce the size of the file and then decompress or decrypt it ..Nothing happening now. Any help will be really appreciated. Thanks | |
Hi. I have a program where I have to sort a list using three different sorts (quick, heap, and merge). I have all the done but now the problem is that I have to calculate the exact complexity on each. IF anyone can help me with how to code that … | |
I wanna extract the data from the file so I can sort it out, add and delete files. How can I do it? My file contains a list of songs with the song name, artist and song duration. Here is what I have so far: [code] //Nathaly Advincula //Song Assignment … | |
I'm writing a program that is supposed to be able to bubble sort data by name and by average. The data I'm given is student last name followed by 3 scores, all put into a text document. I'm to read the names and scores into their respective parallel arrays, and … | |
I would like to initialize a user defined struct with the = operator and a scalar type (for example: double) on its right hand side, like this: [CODE] struct real { double value; double error; ... }; int main() { real x = 1.; // supposing error=0. } [/CODE] It … | |
Hey so this is an assignment and what we have to do is: [quote] Design a class that can be used to represent types of food. A type of food is classified as basic or prepared. Basic foods are further classified as Dairy, Meat, Fruit, Vegetable, or Grain. The services … | |
I am having some issues creating a 2-d vector. I need it to be of a determined length in the first dimension but of an undetermined length in the other. The length in the second dimention will be calculated later in the code, in one of the functions that uses … | |
These function calls are not compiling for some reason, I receive the following error message when I attempt to compile. [QUOTE]hw11.cpp: In function âint main()â: hw11.cpp:70: error: expected primary-expression before â]â token hw11.cpp:71: error: expected primary-expression before â]â token hw11.cpp:71: error: expected primary-expression before â]â token hw11.cpp:72: error: expected primary-expression … | |
I am trying to add a row of int's that are located in separate arrays within my code. I am trying to get these grades to add and then turn it into an avg. My output is crazy though, and I can't figure out why....any ideas? this is the information … | |
Hi, can anyone plz check my code to see why in the prinCLASSdata function the int A, int B ... doesn't have a value. even though it is right in the updateFrequencies function. [CODE]#include<iostream> #include<fstream> #include<string> using namespace std; void read_data(int size,string name[],int test1[],int test2[],int test3[],int test4[],int test5[]); void calculateAverage(int … | |
hi this program starts off with random letters, then using a genetic algorithm eventually forms the "hello world!" basically i need this code to be able to input a word of the users choice, everytime i try something i get an error of some sort thanks [CODE]#pragma warning(disable:4786) // disable … | |
I have been working on a C++ program that is a tic-tac-toe game. The problem is that after I win or lose, the program does not end. Here's the code I have written so far (I even wrote comments to make it easier): [CODE] #include <iostream> #include <ctime> using namespace … | |
I am trying to write a point of sale program. I need to display the menu, the operator enters the lunch order. Total bill is calculated with sales tax, customer payment is accesped and change (if any) is calculated. order summary should be written to a log file that includes … | |
Hi, I've used getline and pushed back a text row into a vector. The vector is of string type and I want to sort out the numbers and store it elsewhere. in my vector: The man is 67 years old and driving an Oldsmobile Rocket 88 I want to sort … | |
Can anyone tell me how or help me to get a Window's Title and save it to a TXT file? I tried couple of things with the GetWindowText() but only manage to get some numbers. | |
The contents of the array are safe within the function, however, upon returning to main the data becomes garbled. section of main: [code=c++] unsigned short tcp_port = atoi("8080"); const char* workDir = "WhatInthe?"; // Parse command line arguments if ( parseCmdArg( tcp_port, workDir, argc, argv) == 1) return 1; cout … | |
[B]Description[/B] I want to have a video conference system. [LIST=1] [*]That is the client-server model. [*]The client can send audio/video/document(like ppt.doc.xls..)/application sharing/chat functions. [*]The client's window can receive 16 videos(from other clients). [*]The client can work on windows platform. [*]The server can work on windows or linux(it's better). [*]The video … | |
Hey guys! I guess my other post wasn't so clear...probably because I wasn't sure what exactly I was trying to do. Anyway, right now I am having problems reading my input file into my 20x20 2D array. I mean, it compiles fine. But, I have a print function just to … | |
This is the answer for one of the simple function question from my programming lab... [CODE]#include <iostream> using namespace std; void displayHi(); int main(void) { displayHi(); } void displayHi() { cout<<"I love c++"; } [/CODE] but what i dont understand is why we should put [B] main(void)[/B]?? why dont simply … | |
I'm having trouble understanding how to write a function call. This is what I have so far: [CODE]#include <ionstream> using namespace std ; int binomial(int n, int k) ; // function prototype int main () { int n, k ; // parameters for the binomial number int result ; cout … | |
Dear All I am trying to create a list of characters already given as below. When I compile it it gives me following errors. In function `int main()': 17: error: `islowerCase' undeclared (first use this function) 17: error: (Each undeclared identifier is reported only once for each function it appears … | |
This must be a frequently asked question, but I can't find the answer in the FAQ, or in the recent archive of this list, or by using google with the keywords I thought of. I would like to use libavcodec.dll and libavformat.dll in my Windows XP Visual C++ 2008 project. … | |
HI.... I'm doing this question... [B]Question Using a non-void function with parameters, write a complete C++ program that prompts the user for the Cartesian coordinates of two points (x1, y1) and (x2, y2) and displays the distance between them computed using the formula: distance = sqrt( (x1-x2)^2) + ((y1-y2)^2)... [/B] … | |
am an engineering student and took the AI course by mistake ! and the doctor asked for this assignment ! and am not a programmer and dunno anythin in c nor c++ so i need your help people please ! 20 marks on this assignment ! 1- build a graph … | |
I made a function SetRegistry() to write a string in the registry like this: [CODE] void SetRegistry() { HKEY hKey; RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,KEY_SET_VALUE,&hKey); RegSetValueEx(hKey, TEXT("filenamehere"),0,REG_SZ,(LPBYTE) "C:\\Windows\\filenamehere.exe",sizeof("C:\\Windows\\filenamehere.exe"); RegCloseKey(hKey); } [/CODE] NOTE: C:\\Windows\\ is the path where the .exe file I want to add is. it sets the string with the filename and … | |
Hello everyone: I am a C++ newbie; I am interesting in using C++ in my work on coupled fluid flow-chemical reaction problems. I apologize in advance for what is probably a very simple question. I would very much appreciate some help to get me on the right track! My goal … |
The End.