49,757 Topics

Member Avatar for
Member Avatar for abhishek2301

Hello, I am stuck with a multiple declaration error during linking. I have 4 C++ source and corresponding header files(A, B, C,D) and one main source file(Main.cpp). Apart from that, I have one header file which contains two function declarations and some #define constants (Config.h) and 2 array decl which …

Member Avatar for Ancient Dragon
0
163
Member Avatar for all blacks

Hi everyone, i need to design a simple grading system and the requirements are as below: [QUOTE]Mark Grade ----------- -------- 90 – 100 A 80 – 89 B 70 – 79 C 60 – 69 D 0 – 59 F[/QUOTE] input.txt -sample input, i have attached the file too [QUOTE]Felix …

Member Avatar for NathanOliver
0
4K
Member Avatar for 3beer

I'm having a file that contain the following: 12345678 abeer ahmed 2007 16-6-1989 8 9 ds121# that line repeated for different names and ids i nedd to sort this lines by gpa how which in that line = 8 how can i do it

Member Avatar for Ancient Dragon
0
115
Member Avatar for bunnyboy

I have to write a template that would swap two arguments, if second one is smaller than first. But in case of string beeing passed to function it would swap them, if second is smaller than first by length. Is it possible to implement that using just one template? Here …

Member Avatar for bunnyboy
0
115
Member Avatar for BlackStar

to do this. A pointer gets created, say Head Would it be better to do this Head = new Node; Head = NULL; or is it better to do this. Head = NULL; Head = new Node;

Member Avatar for BlackStar
0
361
Member Avatar for serkan sendur

hi guys, if you take over a project which is not documented and composed of lots of header files, code files and libraries, what should you do to understand work flow of the project. and if you need to modify some part of it, what should you do to locate …

Member Avatar for serkan sendur
0
87
Member Avatar for mvmalderen

[QUOTE=Ancient Dragon;862638]That is incorrect. The pointer is assigned whatever random value is at that memory location. For example [icode]char *ptr;[/icode] the address of ptr is whatever is at that memory location on the stack (assuming its not a global variable). It is never auto set to NULL by the compiler …

Member Avatar for Ancient Dragon
0
211
Member Avatar for redmaverick

I am not familiar with C code. I want to convert this code to C++ and run it any help is appreciated. [CODE] #include <stdio.h> #include <stdlib.h> #include <time.h> #include<cstdlib> using std::rand; using std::srand; #include <stdio.h> #include <stdlib.h> #include <time.h> /*Global Declarations */ /* define a new type KEY_TYPE as …

Member Avatar for vmanes
0
168
Member Avatar for bilawal420

Using Windows API's how can i copy to another file and Get different properties of a file (size, type, date created and more). i had done reading and writing file plz someone reply me quickly

Member Avatar for siddhant3s
0
72
Member Avatar for gryft

I want to analyze the content of a text file & search for a string in the file. It is assumed a sentence is terminated by a , . ; ? ! This is what i have so far [code] #include <iostream> #include <fstream> using namespace std; int main() { …

Member Avatar for mvmalderen
0
161
Member Avatar for serkan sendur

i have seen an inheritance statement like this [CODE]className : virtual public anotherClassName[/CODE] what does virtual mean there?

Member Avatar for serkan sendur
0
134
Member Avatar for pikkas

i want to use the getexecutiontime() for a function in my program, but i want to use it for a function with arguments and the piece of code that i have is not working because my function have arguments prim_MCST(adj_matrix,nv); [CODE] long getExecutionTime(void (*func)()); // define Function long GetExecutionTime(void (*func)()){ …

Member Avatar for mvmalderen
0
105
Member Avatar for miskeen

Hello, I've a c++ project in linux and I want to create a text file and share it between more than one source file so that I can write into it instead of using only printf. Can anyone help me please? Thank you in advance,

Member Avatar for miskeen
0
106
Member Avatar for booker

Hi boys. This has nothing to do with coding. I have written an excellent peace of simulator in C++,for which I am very happy, for my Masters project for my supervisor. Does anyone of you know how to protect this, an aware like, for possible legal actions taken, in case …

Member Avatar for mvmalderen
0
133
Member Avatar for pczafer

function asks the date and search that day day in buffer and finds and displays all but my codes only displeying firs one, what shoul i do???? [CODE] void displayCerteinDate ( ) { //Find records with certain Date and Display all records in same Date. int newday, newmounth, newyear; bool …

Member Avatar for pczafer
0
91
Member Avatar for localp

i need to know the code for insert in middle, and this is what i wrote, i dont get any errors so theres some logic error in it, so please help me by giving me the correct code. [icode] void List::insertATMiddle(const string x) { Node* p = new Node; p->setData(x); …

Member Avatar for Narue
0
79
Member Avatar for shaynerossum

Hi, I'm trying to declare a pointers value inside of a function, and then manipulate that data the pointer points to. This is the test program I compiled and like the original it gives the error "undeclared identifier". At both occurrences of [icode] *somevar [/icode] in the build function. Thank …

Member Avatar for shaynerossum
0
126
Member Avatar for BlackStar

struct Fast_Food_Business { string name; Fast_Food_Business* head; Fast_Food_business* tail; }; struct cash_registers{ Fast_Food_Business * regist; cash_registers * r; } struct Customer { int n; Customer * h ; // head Customer *t; // tail Fast_Food_Business*next; }; bool menu (const char& number) { return number== '1' || number== '2'; } bool …

Member Avatar for mvmalderen
0
122
Member Avatar for pczafer

function asks the date and search that day day in buffer and finds and displays all but my codes only displeying firs one, what shoul i do???? [CODE]void displayCerteinDate ( ) { //Find records with certain Date and Display all records in same Date. int newday, newmounth, newyear; bool flag …

Member Avatar for mvmalderen
0
100
Member Avatar for drdaco

Hi Everyone, retrying c++ after a 10 year hiatus. F/C scientific programmer here :) So I have this really really long data file. It has a header and I want to locate the heading just before the data rows begin. The heading size may change from different sources, but the …

Member Avatar for drdaco
0
113
Member Avatar for MicrosoftMahmou

hello, iam very beginer in c++ and i have home work in matrices i want to know a method to make matrices and collect them by using array & pointer note i want to make a matrix code which make me type any matrices with any number of row or …

Member Avatar for mvmalderen
0
94
Member Avatar for pikkas
Member Avatar for pikkas
0
129
Member Avatar for nanchuangyeyu

Hi, I tried to present a 2D mathematic matrix with C++ vector and expand it by repeating the first and last row and column. An example for intuition, I initialized a 2D C++ vector vec_2d to be as following: 1, 2, 3, 4 5, 6, 7, 8 9,10,11,12 13,14,15,16, and …

Member Avatar for Narue
0
193
Member Avatar for rush1

Hi, I have no1 to no30 product prices. I want to calculate combination for 30 product prices Suppose I have 30 different numbers.. I want to calculate their sum by using combination. But combination should not repleted i.e. E.g for 4 numbers... [ 10 20 30 40] I want to …

Member Avatar for rush1
0
103
Member Avatar for tgsoon2002

I have some code to cout the line from file. and to use it to find word in the file. ifstream bfile("test1.txt"); for(int i=0;i<=4;i++) {bfile>> word[i];} for(int i=0;i<=4;i++) {line = line+ " " + word[i]; } cout<< line<<endl; after that use find word in string to find or edit in …

Member Avatar for ArkM
0
79
Member Avatar for tahir90

hi,i am new to this site where i can chat with people on this site? is there some one who know a good programmer? i want to know how to make a program to bubble sort 2d array by using for loops and without using setw in c++. plz reply …

Member Avatar for ithelp
0
161
Member Avatar for funfullson13

Hello! I want to add a "press .. " in my program. ( console ) I'm using Linux so I cant use windows.h or conio.h thanx

Member Avatar for funfullson13
0
109
Member Avatar for jrynik

Hello, I am working on a program, part of which is opening a file. As I expect the program to check if the (text) file contain certain data. That's why it would be useful if program users could enter the file to check. I've tried to do it by combining …

Member Avatar for jrynik
0
144
Member Avatar for SCoder1

This program is very tricky... First off it's an ATM I coded and every time you as for money back or put money in or ANYTHING it the name and account number gets re-entered. Here's the code: [icode] #include <cstdlib> #include <iostream> #include <iomanip> using namespace std; float opening_bal = …

Member Avatar for SCoder1
0
74
Member Avatar for ulisse0

Hi, I wrote a simple on-file directory lister. It works, but I have to press Ignore in a block damage error messagebox everytime I tun it. Any idea? Thanks in advance. [code] #include <windows.h> #include <iostream> #include <string.h> #include <string> #include <direct.h> #include <stdlib.h> #include <stdio.h> using namespace std; int …

Member Avatar for mvmalderen
0
159

The End.