49,761 Topics
| |
I have to write a program to process txt file, using seprate chaining i have to store top 50 occuring word in txt file. | |
The below code simply reads the string **"This is a test"** from a text file and displayes it on the console. I've deliberately placed an endline at the end of each time the string is loaded to show that the string is all that is passed to '**mystring**' from '**myfile**'. … | |
Hi ! I have arrray A[n][n] and i can input numbers in the interval -100 and 100 . I need to copy array A to array C[n*n] , and copy the number who are in a user iputed interval [k;l] and sort array C. I need help . I out … | |
ok, NEED HELP HERE TO GET ALL THE CHARACTERS IN THE TEXT FILE AS A FULL LENGTH AND DO SOMETHING WITH IT... Line 31 #include "stdafx.h" #include<stdio.h> #include<stdlib.h> #include<string.h> #include <iostream> #include <iomanip> #include <string> #include <sstream> #include <fstream> #ifndef _DEPRECATION_DISABLE /* One time only */ #define _DEPRECATION_DISABLE /* Disable … | |
I am having a problem with readin input data, my program is reading the last name in my .txt document twice and inserting it into each one of my functions an extra time. here is the out put Enter the name of the .txt file that you want to open … | |
1. Write a C++ program that simulates the throw of a dice. The program allows the user to enter the number of throws he/she would like to do. The program then, will calculate the statistics of the number of faces appears in these throws. The program should satisfies the following: … | |
#include <iostream> #include <conio.h> using namespace std; void showSeats (void); char firstClass[2][6]; char busClass [5][6]; char ecoClass [6][6]; int main() { char seatType; int seatNum; char seatChar; // make all the seats available for(int i =0; i<6; i++) { for(int j =0;j<6;j++) { if(i<2) firstClass[i][j]='*'; if(i<5) busClass[i][j] = '*'; ecoClass … | |
# include <iostream> # include <fstream> # include <string> using namespace std; struct primera # include <iostream> # include <fstream> # include <string> using namespace std; struct primera { int ID; char nombre [50]; char fecha_de_alta [10]; char fecha_de_caducidad [10]; int cantidad_en_existencia; char marca_presentacion [50]; float costo_para_mi; float bonificacion; float … | |
the csbi.wAttributes are combinations of '|' operators,... DWORD textcolor = csbi.wAttributes & 0xff0f; DWORD backcolor = (csbi.wAttributes & 0xfff0) >> 4; i understand the 0xff0f is a hexadecimal value(i don't know in decimal), but why these number and not other? can anyone explain to me these 2 calculations? (they are … | |
i have these code for clear the screen: //clear the Console void Clear(int BackColor=0) { // home for the cursor COORD coordScreen = {0, 0}; DWORD cCharsWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD dwConSize; // Get the number of character cells in the current buffer if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) return; dwConSize = csbi.dwSize.X * csbi.dwSize.Y; … | |
the prototype function is: BOOL WINAPI WriteConsoleOutputAttribute( _In_ HANDLE hConsoleOutput, _In_ const WORD *lpAttribute, _In_ DWORD nLength, _In_ COORD dwWriteCoord, _Out_ LPDWORD lpNumberOfAttrsWritten ); i'm trying use it for the 1st time... what means: "lpNumberOfAttrsWritten [out] A pointer to a variable that receives the number of attributes actually written to … | |
Thats the code i have so far: int _tmain(int argc, _TCHAR* argv[]) { for ( int i = 1; i <= 9; i++) { for ( int j = 1; j <= 15; j++) { cout << "*"; } cout << endl; } return 0; } but can't figure out … | |
I'm trying to convert int x and y arrays to string using a sample code found online. string Square::int2string (int x[]) { string returnstring = ""; for (int i=0; i < 4; i++) { returnstring += itoa(x[i]); return returnstring; } } but hit with the following error. Square.cpp:30:8: error: prototype … | |
#include <string> #include <iostream> #ifndef NAME_H #define NAME_H class Name { private: std::string first_,last_ ; public: explicit Name(const std::string & first = "john", const std::string & last = "doc"):first_(first),last_(last) { if(!isvalidlast(last_) || isvalidfirst(first_)) throw "Name :: Name(const string &,const string &):invalid Name"; } static bool isvalidlast(const std::string & last){} static … | |
How To Determine The Best Score? I am doing a lab regarding 'guess number game' Actually,the answer should be the random number,but I set the exact number to 88,because it is easy for me to test other requirement. I need to printf("Best Score so far [X]") How to make comparison … | |
i know use SetConsoleTextAttribute(): SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), ForgC|(BackC<<4) ); (too be honest: i don't have sure if i can avoid the '<<4') i need ask these: can i add it more data and then use it? like: Blink=128 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), ForgC|(BackC<<4) | Blink); and then test if these value is there? | |
Hello, Need some help with Pointers, please. I have base class ShapeTwoD and 3 derived classes: Cross, Rectangle and Square. Each have different x and y values input by user. Eg, Cross has 12 sets of x,y coordinates, Rectangle and Square have 4 sets each. Can I know how to … | |
Hi All, I was assigned to code a project which to some extend simulates timetable of an airport. This has to be implemented using linkedLists. The poject should consist of Node class and SLL (singly linked list) class. The logic of the project is like this: There should be a … | |
Hi guys, I want to construct 2D shapes in C++ program. I want to get as output an array of 2D points representing the 2D shape, while the input is the 2D shape parameters. For example, I want to pass to the function the center and radius for a circle, … | |
I need help reading a bool function from my HW assignment, I am not asking you to do complete my assignment for me. All I need help with is reading my bool function in main. Thank you for looking #include<iostream> #include<fstream> #include<string> using namespace std; struct StudentType {string studentName; int … | |
| I'm trying to do the following: 1. get username typed into the userField 2. make a SEARCH mysql_query with the username as a variable I'm having a hard time getting past phase 2 since mysql_query takes a const char* as the query string, and I can only get username as … |
**Why is it that when i use ctime to capture the time I am getting this error: time_t now = time(0);// convert now to string form char* dt = ctime(&now); cout << "The local date and time is: " << dt << endl; error C4996: 'ctime': This function or variable … | |
I just need a simple program fragment that saves sentences/phrases and can load as exactly as the input. Do not rely on this code as I had made several failed attempted solutions. This is only what I remember: #include<fstream.h> #include<iostream.h> #include<string.h> #include<conio.h> main() {int x=0;char strings[5][50]; ofstream save("data.txt",ios::out) while(x<5) {gets(strings[x]); … | |
How would i output my vector of strings into a ".txt" file? | |
Okay, so I know how to reverse the whole string of a vector, [code]for_each(newLines.begin(), newLines.end(), [](std::string& s){ reverse(s.begin(), s.end()); }); copy(newLines.begin(), newLines.end(), std::ostream_iterator<std::string> (std::cout, "\n")); [/code] But is there a way to only reverse the first 10 or so characters of a vector string? i.e. sdjkfskjd sfdsdf sdjflkjsdjklfsdlkjflksdjfkls jklda sdfioss … | |
Hello! I am trying to implement a persistent data structure using a vector of linked lists, but each time I am adding the modified list to the vector, all the old entries seem to be updated... Could you please help me? Definition of the vector of linked lists (the list … | |
please can you help me to solve this problem :>>> no develop a bookstore information system. The bookstore manages a collection of books it is selling, book orders, and customers who purchased from the store. A book store also has a counter that accepts cash from book sales. Each book … | |
The End.