Posts
 
Reputation
Joined
Last Seen
Ranked #121
Strength to Increase Rep
+15
Strength to Decrease Rep
-3
89% Quality Score
Upvotes Received
286
Posts with Upvotes
252
Upvoting Members
160
Downvotes Received
39
Posts with Downvotes
34
Downvoting Members
21
75 Commented Posts
~718.23K People Reached
Favorite Tags

1,494 Posted Topics

Member Avatar for vegaseat

The difference between a democracy and a dictatorship is that in a democracy you vote first and take orders later; in a dictatorship you don't have to waste your time voting. Charles Bukowski

Member Avatar for Reverend Jim
15
13K
Member Avatar for adoleh

You have some fundamental problems with your code especially the lack of a proper formating scheme..Also please use code tags. [code] #include <iostream> using namespace std; int main() { int num; cout << "Enter a two-digit number:\n"; cin >> num; int ones_digit = num%10;//preform these operations int tens_digit = num/10;//after …

Member Avatar for emsmary
0
16K
Member Avatar for GadiK

Here's a quick example of a parent receiving from a child which receives from a child...It should be 'mostly' correct. [CODE] #include <stdio.h> #include <stdlib.h> #include <unistd.h> enum PIPES {READ, WRITE}; int main(int argc, char**argv) { int hpipe[2]; pipe(hpipe); if (fork()) { /*parent*/ char ch; close(hpipe[WRITE]); dup2(hpipe[READ], 0); close(hpipe[READ]); while …

Member Avatar for Riadh_1
0
12K
Member Avatar for munitjsr2

Really, why would you want to? You know that some of the binary characters have no ascii representation, hence can't be displayed. It would be better to display each binary value in hex, thus displaying each and everyone of them.

Member Avatar for AssertNull
0
3K
Member Avatar for tegaelam

Instead of starting at zero and incrementing try starting at columns value and decrementing to zero..

Member Avatar for Reverend Jim
0
3K
Member Avatar for cpsusie

Measuring execution time is a very complex task...just check the link titled [pdf]Measuring Program Execution Time [url]http://www.google.ca/#hl=en&source=hp&q=linux+execution+time&btnG=Google+Search&meta=&aq=1&oq=linux+execu&fp=7e102d89cbdc458f[/url]

Member Avatar for Zack_7
0
12K
Member Avatar for kylcrow
Member Avatar for pavankumar77

[CODE] #include <iostream> unsigned int addone(unsigned int x) { unsigned int y = 0; unsigned int z = 0; for (int i = 0; i <= 31; ++i) { z = (x<<(31 - i))>>31<<(i); if (z > 0) { x = x ^ z; } else { y = x|0xffffffff; …

Member Avatar for pritaeas
0
643
Member Avatar for Dave Sinkula

In my very limited view of C++, I find Accelerated C++ and Ruminations on C++ very beneficial to the newest C++'ers. Its such a great introduction to the understanding of the principles of the language. Thank-you Andrew Koenig and Barbara Moo..I appreciated yours words of wisdom.

Member Avatar for shahidali6
11
10K
Member Avatar for LostnC

For starters, you might want to move this above the main() function like: [CODE] void swap(int *, int *); //prototype with a pointer parameter int main() { ... } [/CODE]

Member Avatar for deceptikon
0
3K
Member Avatar for Jfunch

Try creating a pipe. Here's a simple example. [code] #include <iostream> #include <unistd.h> enum PIPES {READ, WRITE}; int main(int argc, char**argv) { int hpipe[2]; pipe (hpipe); if (fork()) { close (hpipe[WRITE]); int x = 0; while (true) { read (hpipe[READ], (char*)&x, sizeof(int)); if (x < 0) break; std::cout<<"child recieved->"<<x<<"\n"; } …

Member Avatar for Kyle_4
0
3K
Member Avatar for gerard4143

I have a simple question about unicode and utf8. How does a utf8 encoding know what its uppercase encoding is? I understand how utf8 encoding carries its unicode value embedded in itself but I fail to see how it maps a utf8 encoding to an uppercase unicode value. What is …

Member Avatar for deceptikon
0
163
Member Avatar for Vandithar
Member Avatar for maha harshini
0
407
Member Avatar for inspire_all

Line 27 should be: [code] c.str[m]=' '; [/code] Line 29 should be: [code] for(int len=m+1;(*b.str)!='\0';len++) [/code] This is how I would solve it: [code] class string { public: char& operator[](int offset); const char& operator[](int offset) const; friend string operator+(const string & lhs, const string & rhs); }; const char& string::operator[](int …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for Shreerang
Member Avatar for inspire_all

How can i do it? Depends. Do you want to overwrite the characters or do you want to insert the characters and shift everything down..

Member Avatar for naveen1993
0
213
Member Avatar for Rallici

[QUOTE=Rallici;1465475]I aint ganna lie. I have no clue how to attempt this I have read about it online but every time i attempt to i fail miserably.[/QUOTE] I would delete the compiler/IDE and then reinstall it.

Member Avatar for learner_new
0
2K
Member Avatar for taverasme

Try something like below: [CODE] #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char inputstr[128]; char *cptr = &inputstr[0]; size_t thesize = 128; while(1) { if(feof(stdin) != 0) { break; } getline(&cptr, &thesize, stdin); printf("input string is : %s\n", inputstr); } getc(stdin); return 0; } [/CODE]

Member Avatar for Nikolas9896
0
6K
Member Avatar for fahadmunir32
Member Avatar for baid.arham619

I think you are confused. First you write the program and then you post it with any problems you are having.

Member Avatar for samson.dadson.3
0
273
Member Avatar for radu.nuconteaza
Member Avatar for nhrnjic6

The solution or hints of a solution depend on which data structures you plan to use. Could you post what you have so far?

Member Avatar for nhrnjic6
0
153
Member Avatar for karma2you

I have a question about this line scanf("%d", &val); Why are you reading a integer into a character? Won't it make more sense to read the characters directly into the character array? scanf("%20s", a);

Member Avatar for Ancient Dragon
0
245
Member Avatar for Pia_1
Member Avatar for deceptikon
0
202
Member Avatar for Ahtsham

Well 3 divided by 5 has 3 left over. The modulus operator computes the remainder of integer division.

Member Avatar for richieking
0
278
Member Avatar for Fedoros

I guess you are not aware of our homework policy. We don't do homework problems. If you want help with a specific problem then you'll have to post the code and indicate exactly where and what the problem is.

Member Avatar for Fedoros
0
121
Member Avatar for CreatorZeus

You can set the delimiter for getline(). istream& getline (istream& is, string& str, char delim); Please check out this link http://www.cplusplus.com/reference/string/string/getline/

Member Avatar for deceptikon
0
260
Member Avatar for hemanshurpatel
Member Avatar for samer.aboufakher.3

You seem to be missing the opening brace here void toss(int & x)//missing brace here //0=heads 1=tails x=rand()%2;

Member Avatar for samer.aboufakher.3
0
188
Member Avatar for roshan.parate.73
Member Avatar for ArnoldRich

I think you can use any compiler which has the ability modify the linker, GNU's compiler has linker scripts which controls this important aspect.

Member Avatar for ArnoldRich
0
178
Member Avatar for mixelplik

Try running this program with your data. #include <iostream> #include <fstream> using namespace std; int main(int argc, char** argv) { ifstream names; names.open("P25.txt"); string data; while(names >> data) { cout << "You read->" << data << "<-into data!" << std::endl; } names.close(); return 0; }

Member Avatar for mixelplik
0
1K
Member Avatar for MacErich
Member Avatar for girmanigatu
Re: c++

C++ is a play on the C programming language increment operator. C++ literally means C language incremented. What's the purpose of it? Here check the wiki http://en.wikipedia.org/?title=C%2B%2B

Member Avatar for Slavi
0
139
Member Avatar for dp121307

Are you sure your compiling this with a C++ compiler? Could you be using a C compiler?

Member Avatar for Ancient Dragon
0
299
Member Avatar for centenond

Well this is how you access an element of std[100] and get its elements. std[searchid].id std[searchid].name std[searchid].fatherName std[searchid].motherName

Member Avatar for centenond
0
190
Member Avatar for sixtorodriguez

Try reopening the input file or setting the file position back to the beginning with fseek() on line 22.

Member Avatar for sixtorodriguez
0
323
Member Avatar for COKEDUDE

The GCC compiler has a switch -std which can determine the language standard. Try searching this link for the -std switch options. http://linux.die.net/man/1/gcc

Member Avatar for Mouche
0
431
Member Avatar for somjit{}

Shouldn't this have a semi-colon after it? struct item { int* num ; int* q; };//semi-colon Why are the structure elements pointers? If you insist on pointers then you'll have to allocate memory for them or point them to valid memory before you use them.

Member Avatar for Mouche
0
294
Member Avatar for gerard4143

I'm curious as to where a member would post a question on ML(Ocaml) type language?

Member Avatar for Dani
0
117
Member Avatar for mixelplik

If you insists on breaking out of the loop immediately then you should use break. Something like this... #include <iostream> #include <iomanip> using namespace std; int main() { int employeeNumber = 0; while( true ) { cout << "\nEmplyee Number: "; cin >> employeeNumber; cout << endl; if ( employeeNumber …

Member Avatar for mike_2000_17
0
149
Member Avatar for priyanka.choudhary.90038
Member Avatar for meja

Well what do you need help with? Please post the code you attempted and highlight any sections and explain the problems.

Member Avatar for Ketsuekiame
0
229
Member Avatar for Slavi

If you want to save yourself some frustration then don't include this in your header file using namespace std; Header files shouldn't expose anything in a namespace.

Member Avatar for Slavi
0
1K
Member Avatar for Vigenere

Did you try the function tolower()? You could apply this to each character and perform any calculations to the result.

Member Avatar for tinstaafl
0
569
Member Avatar for KrazyCod3r

This forums provides help to users who have specific questions. It isn't a free programming advice column.

Member Avatar for KrazyCod3r
0
308
Member Avatar for Alonso_1

I would have to say that you need a flagging system which marks a integer element when its been counted. Are you sure this is C? for(int i = 0; i < 10; i++) { ... }

Member Avatar for deceptikon
0
3K
Member Avatar for chubbyy.putto

The arrays are fine! Do you have another problem with the code? Doesn't this for loop run past your arrays? for (int d = 0; d < 10; d++)//arrays have five elements { ... } This function returns int but you return boolean inside the function. What does this function …

Member Avatar for gerard4143
0
112
Member Avatar for refphlex

Looking at your code I find that you have to make a decision. Do you want to calculate the average once and store the value in the structure Student or do you want to calculate the student average each time you need it. void Print_List(Student List[], int Size) { cout …

Member Avatar for refphlex
0
453
Member Avatar for james.lu.75491856

Number one. Why all the semi-colons? Here. Can you spot the error now? class Timerange { public: Timerange(string initstring) { string current = ""; unsigned short mode = 0; string timeA; string weekday; string timeB; for(unsigned short i = 0; i<initstring.length(); i++) { char c = initstring[i]; if (c == …

Member Avatar for gerard4143
0
268

The End.