456 Posted Topics

Member Avatar for negru

Try this: http://www.mindviewinc.com/CDs/ThinkingInC/ And this: Six Fast Steps to Programming in C http://developers-heaven.net/forum/index.php/topic,2022.0.html

Member Avatar for deceptikon
0
183
Member Avatar for Ahmed Padela

Please start a new thread with each new question. If you are wishing for help with an 'home-work' problem ... you firstly NEED to try to code a solution yourself ... AND THEN (and only then) .. submit what you have coded ... along with a description of your problem.

Member Avatar for David W
0
584
Member Avatar for ArpitJ.25

What C++ compiler are you using? It would help to show your programs output also.

Member Avatar for David W
0
156
Member Avatar for Juan_11

This example to a similar problem may help you to rethink / restart your code. // rowsOfStars.cpp // // demo of a way to accept ONLY VALID inoput ...// /* So i am new to c++, I don't know what is wrong with my program, I keep looking for the …

Member Avatar for David W
0
462
Member Avatar for prgmmgbgnnr

Here is how I might start to tackle a problem like this ... Note the comments in the program to find all the .h files needed to test it out. You can find file "CvecOfString.h" at: http://developers-heaven.net/forum/index.php/topic,2580.msg2865.html#msg2865 You can find file "readLine.h" at: http://developers-heaven.net/forum/index.php/topic,2580.msg2864.html#msg2864 You can find file "Cvec.h" at: …

Member Avatar for David W
0
303
Member Avatar for simran_5

Do you know how to (start the) code for a C++ class? Show us as much as you can ... (i.e. fill in your code for) : #include <iostream> // ... class Teacher { public: // ... private: // ... } ; class Student { friend class Teacher; public: // …

Member Avatar for David W
0
169
Member Avatar for Medusa Tomsin

Further to @Dani comments ... Naming conventions like using ALL_CAPS for global const values helps the reader 'see' that the value is a 'global const value' Using descriptive names also helps the reader follow the 'logic flow' and lends to 'self documentation as you go'

Member Avatar for 0x69
0
106
Member Avatar for Sara_13

A next step might be to use functions to get valid input in a loop? Also maybe use a struct tp hold the 'counts'? Take a look: // countPosNeg.cpp // // 2015-0915 // #include <iostream> using namespace std; struct Counts { int pos, neg; // default ctor... Counts() : pos(0), …

Member Avatar for David W
0
289
Member Avatar for egieboom12

Try here (some beginning steps): http://developers-heaven.net/forum/index.php/topic,2019.0.html http://developers-heaven.net/forum/index.php/topic,2022.0.html

Member Avatar for rubberman
0
149
Member Avatar for naz1234

If you just want the 'inclusive count of numbers' enter beginning number in beg enter ending number in end inclusive count of numbers is: end-beg+1

Member Avatar for nullptr
0
212
Member Avatar for COKEDUDE

You could try code like the below example, that uses these .h files: Note: you can find needed (include) files as per below ... CListOfString.h http://developers-heaven.net/forum/index.php/topic,2582.msg2882.html#msg2882 readLine.h http://developers-heaven.net/forum/index.php/topic,2580.msg2864.html#msg2864 Clist.h http://developers-heaven.net/forum/index.php/topic,2582.msg2877.html#msg2877 /* split2.h */ /* this version: 2015-08-07 */ /* http://developers-heaven.net/forum/index.php/topic,46.0.html */ #ifndef dwSPLIT_H #define dwSPLIT_H #ifndef DELIMITS #define DELIMITS " …

Member Avatar for David W
0
245
Member Avatar for toneranger

Perhaps the longer data file is too long to handle? Try splitting it up into 1/2's and see if each 1/2, by itself, processes ok? Is you output file looking correct for the smaller file that you said seems to run ok? I would have thought your code would be …

Member Avatar for David W
0
307
Member Avatar for zelrick

You could read/skip the first 2 lines ... Then read 2 lines, skipping over that first line and parsing the 2nd line ... till done You could use stringstream objects to ease parsing each line of numbers you wish to parse.

Member Avatar for zelrick
0
2K
Member Avatar for Sandeep_14

Welcome to Daniweb. Please note! We will be able to help you if you firstly show us the code you have tried so far ...

Member Avatar for David W
-2
133
Member Avatar for Pavol

This may get you started ... # removeSimilarItems.py # # 2015-08-29 # lst = [ ['e', 1, 2], ['e', 2, 1], ['e', 1, 2], ['e', 2, 3] ] lst2 = [] for item in lst: if item in lst2 or [item[0], item[2], item[1]] in lst2: pass else: lst2.append( item ) …

Member Avatar for David W
0
307
Member Avatar for Sandeep_14
Member Avatar for David W
-1
955
Member Avatar for anumash

> Standard C and C++ do not support nested functions, but: GCC supports nested functions in C, as a language extension... https://en.m.wikipedia.org/wiki/Nested_function Note: in C++, it seems you are limited in 'nesting classes' to ... you can 'nest' a class inside a class.

Member Avatar for David W
0
210
Member Avatar for Varad_1
Re: CPP

Do NOT use the above link ... because, the 'Hello World' example program there does NOT conform to standard C++ ... Standard C++ uses: "int main()" #include <iostream> //using namespace std; int main() { // your code goes here ... for example ... std::cout << "Hello World" << std::endl; // …

Member Avatar for David W
-2
164
Member Avatar for Gudger

> My teacher say, that we should use stdio.h kg conio.h stdio.h is commonly used for io (input/output) for programs in C, so you would be better to post this question in the DANIWEB C forum Do NOT use conio.h if you want to code using standard C and thus …

Member Avatar for New Jack
0
291
Member Avatar for Syed Zeeshan Ahmed

Do you know how to input a long C string? In a loop, you could prompt (use printf) and then use fgets and a large char buffer (length pre-fixed at compile time) to input your test C string of a's and b's ... or you could use a readLine function …

Member Avatar for David W
0
261
Member Avatar for ovimanyrobin

You might like to also see this: Six Fast Steps to Programming in C http://developers-heaven.net/forum/index.php/topic,2022.0.html

Member Avatar for David W
0
135
Member Avatar for you207

You might like to use some C++ library functions to assist parsing a line ... http://developers-heaven.net/forum/index.php/topic,2019.msg2682.html#msg2682

Member Avatar for David W
0
563
Member Avatar for Mir Mahfuz

> count frequency Your title might have given you an hint about what was happening ... Your goal seems to have been to find the frequency of each lower case letter in some input string ... lower case letters in the range 'a' to 'z' Note also the 'hint' further …

Member Avatar for David W
0
182
Member Avatar for lewashby
Member Avatar for ipswitch
0
301
Member Avatar for tgreiner

Check you code with this ... // dotProduct.cpp // // 2015-07-23 // // find dot product and angle between ... two (2D) vectors (Points) // #include <iostream> #include <string> #include <cmath> // re. ceil // ok to do this, for now using namespace std; const string INTRO = "This program …

Member Avatar for ipswitch
0
2K
Member Avatar for Mahnoor_1

Since you have supplied the most part of the code ... you might like to see this little further 'edit' that might help you to continue ... Edit: use a C++ 11 or greater compiler // CStack.h // #include <iostream> #include <string> #include <stdexcept> // using namespace std; class cInvalidStack …

Member Avatar for ipswitch
0
372
Member Avatar for Dhana_1

>This is not actually a programming question (or rather, to solve this by simulating the behaviour of the robot is a bad way to solve this). This is a simple maths question. Solve it on paper first. Actually, this is a good program to tackle by computer simulation ... as …

Member Avatar for rproffitt
0
171
Member Avatar for Eng-Mohammed

Can you code a C++ program that prints a message to ask for input? (Hint: look up: C++ cout) Can you code to take in a number? (Hint: look up: C++ cin) Do you know how to use an if ... else if ... structure in C++? (Hint: look up: …

Member Avatar for David W
-1
124
Member Avatar for lewashby

Did you google for pdf file format? But ... since the software you were using is NOT supported any longer ... why not write your own data input forms?

Member Avatar for Gribouillis
0
474
Member Avatar for Aabir

1) Get an up to date compiler (many are free like this one: http://sourceforge.net/projects/orwelldevcpp/ 2) Do not use conio.h ... or getche ... to keep code portable 3) Define your functions outside of main function ... before called 4) See example of how modern C++ looks ... // hello.cpp // …

Member Avatar for NathanOliver
0
511
Member Avatar for Seth_1

Can you export your data base from Oracle to a spreadsheet like Excel ... as a csv file ... or csv files ? If so, then you can easily code for a C++ program to input and parse each csv line from that file / those files ... Put/parse each …

Member Avatar for David W
0
147
Member Avatar for fputs

In standard C you can create files ... http://www.cplusplus.com/reference/cstdio/FILE/ http://www.cplusplus.com/reference/cstdio/fopen/ But ... I do not think there is *a standard way* to delete a file.

Member Avatar for David W
0
198
Member Avatar for jakson321

This 'question' may be a little 'stale' by now, but an edit/fix of the OP's code, may serve as a demo for other C students who stop in at Dani's fav student place, The following C code is an example of how pointer arithmetic could be used *exclusively* in a …

Member Avatar for David W
0
1K
Member Avatar for jamesjohnson25

Did you see the other post with fixes/edits to your code ? Please mark that (primary post) as 'solved' ... and in the future, please try to avoid 'duplicate posts' :)

Member Avatar for David W
0
169
Member Avatar for clife

You may like to see this ... (uses some freely available custom C utility files ... so see the comments for links to files needed in the example program.) /* parseDataFile2.c */ /* NOTE! the include file readLine.h ... IS available at: http://developers-heaven.net/forum/index.php/topic,2580.msg2864.html#msg2864 */ #include "readLine.h" const char* FNAME = …

Member Avatar for David W
0
248
Member Avatar for jamesjohnson25

You may like some fixes/edits ... as per the following 3 files: file 1: // BankAccount.h // #include <string> class BankAccount { public: BankAccount( const int accNumber, const std::string& accName ); void setAccNumber( const int accNumber ); int getAccNumber() const; void setAccName( const std::string& clientName ); std::string getAccName() const ; …

Member Avatar for David W
0
590
Member Avatar for Nikkitha

If you'd like a 'nudge' about how to get started ... then please just ask. Can you code to print a prompt and then take in a string? If the first 5 char's of the string, (the first 2 strings), are always the customer ID, can you then code to …

Member Avatar for David W
0
154
Member Avatar for rakib.tanbir

You really do need to show us what you have tried so that we may see where you are having difficulty. There are exceeding many 'C++ class' example programs all over the WEB ... that could give you good ideas about how to get started. For a recent example of …

Member Avatar for David W
-1
265
Member Avatar for daystarsam

You might like to see this ... Directed Graphs (digraph) and Weighted Directed Graphs (wdigraph) http://developers-heaven.net/forum/index.php/topic,2614.0.html It may help you to get started?

Member Avatar for Schol-R-LEA
-2
136
Member Avatar for kumanutiw

You need to firstly solve the math before you can code ... It is often helpful to solve a much simpler problem at first. If you start out with a retangular solid wall of height hw and width ww the surface area Aw = hw*ww And if the side surface …

Member Avatar for David W
0
501
Member Avatar for ~s.o.s~

A new link C students may like to have (that's had over 17,000 visits in the first 25 days): C SOME UTILITY functions ... http://developers-heaven.net/forum/index.php/topic,2608.0.html

Member Avatar for mack1
29
5K
Member Avatar for Tcll

If I understand your problem, the solution is to define an 'inverse function' for each 'function' : def numSquared( num ): return num*num def inverseNumSquared( num ): return num**0.5

Member Avatar for Tcll
0
304
Member Avatar for vegaseat

Since this thread has been a little resuscitated ... it may be the case that some beginning students in C ... might like to know ... that a simple bubble sort (usually used ONLY on very small data sets - arrays) can be used effectively on a very large data …

Member Avatar for David_50
5
746
Member Avatar for tgreiner

> Can there be a vector of structures? Yes > I am guessing that with data.push_back(temp) the .push_back(temp) is a feature of the vector type. But, it does not seem to indicate a specific element identification in the vector data. How would you access something like the 123rd element in …

Member Avatar for David W
0
485
Member Avatar for biko stevens

Can you show us the code you have tried so far? We really have no idea what your problem is ... until you show us that code. Try this next link .... http://developers-heaven.net/forum/index.php/topic,2019.0.html to get some ideas how to get started with input of data in a loop.

Member Avatar for David W
-2
68
Member Avatar for ram619

If you just wish to reverse the order of the lines in the array ... try this: /* demo_str_rev.c */ #include <stdio.h> void str_rev( char* ary[], int size ) { int i, j; for( i = 0, j = size-1; i < j; ++ i, --j ) { char* tmp …

Member Avatar for David W
0
205
Member Avatar for ram619

You could try something like this: /* test_replace.c */ #include <stdio.h> #include <string.h> /* ... need to find a substring in a array of char* and replace it with another string ... */ #define MAX_SIZE 40 const char* getRevisedStr( const char* line, int len, const char* old, const char* new …

Member Avatar for ram619
0
347
Member Avatar for lewashby

Take a look here: http://fredosaurus.com/notes-cpp/oop-condestructors/shallowdeepcopy.html

Member Avatar for Moschops
1
170
Member Avatar for Alan_7

Do you know how to code a working shell program in C++ ? Do you know anything about using a C++ struct (or class) ... to hold the data for each Student? Do you know how to use the C++ library list (i.e. a double linked list) ? Do you …

Member Avatar for David W
-2
656
Member Avatar for Utopia_1

Since this was your very first post at Dani's 'student friendly' place ... Do you have any idea how to start? 1. Is your data to be read from file ... or ... 2. is it to be entered by the user via the keyboard after a prompt ... or …

Member Avatar for David W
-3
174

The End.