49,761 Topics

Member Avatar for
Member Avatar for pczafer

can anybody tell me how can i call [QUOTE]displayHeading();[/QUOTE]function for only first if statement??? [CODE]void displayCerteinDate ( ) { //Find records with certain Date and Display all records in same Date. system("cls"); //clear screen int newday, newmounth, newyear; bool flag = false; cout<<"\nEnter the Date You want To Display (dd …

Member Avatar for pczafer
0
92
Member Avatar for valtikz

I have a Gtk TreeView named phoneBookTreeView Gtk::TreeView * phoneBookTreeView; can someone help me how to sort all the contacts inside the TreeView? if I have a code like this for sorting the contacts byname: [code]void PhoneBookModel::sortByName( Glib::RefPtr<Gtk::TreeSelection> selection ){ /* Enter SortByName Function here */ }[/code] what would be …

Member Avatar for Nick Evan
0
86
Member Avatar for Duki

So my Data Structures class has finished the book we were using, but we still have a week of school left. My instructor has started going over binary files... only problem is I wasn't there when he went over it. My assignment is to open a binary file, save the …

Member Avatar for vmanes
0
148
Member Avatar for Mem21

What does the below statement do in c++, i have seen these being used in alot of programs. 1.ifstream ipfile; 2. ipfile.fopen(ipfname); 3. char buffer[BUFLEN]; 4. cout.put('\a'); 5.

Member Avatar for siddhant3s
0
109
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
164
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
382
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 tux4life

[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
213
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 tux4life
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 tux4life
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 tux4life
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 tux4life
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 tux4life
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 tux4life
0
95
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
162

The End.