- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 48
- Posts with Upvotes
- 44
- Upvoting Members
- 34
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
- PC Specs
- Dell Inspiron 1525, Ubuntu GNOME 13.10
Re: I'm 11 years old and I'm absouloutly LOVE programming. I'm learning C++, but I heard that C++ is used for creating games. Where can I learn game development online for free. | |
Re: This problem is to print a square using a number that the user enters, which would be in the center. If the user entered a 5, then the program should output this: 111111111 122222221 123333321 123444321 123454321 123444321 123333321 122222221 111111111 If you're wondering, this was not a homework assignment. … | |
Re: Should I get ubuntu on my mac? Is it good for programming? Does DirectX support linux? | |
Re: I'm new to C and I'm trying to convert decimal to binary. The result is giving me an inverse number of what's required. I tried to apply modulo on the result like I saw on other forums but I still get the same result. Any help? #include<stdio.h> int main() { … | |
Re: I have a method in foo class that needs to be initialized in my main.cpp and inside another method of foo.cpp. basically my example has a mainPage then will allow to user to do addition or subtraction depends on their choice. after the addtional/subtraction method is done, it will go … | |
Re: Following up on a discussion on [this thread](http://www.daniweb.com/software-development/cpp/threads/470519/looping-using-recursion/), I did some tests on the performance of recursion vs. iteration, and some interesting things happened, so I thought I would share the results. I'm gonna structure this a bit like a lab-report, because that's really the best way to put it. … | |
Re: //this is a mine...sieve's algorithm implementation please tell me where i am going wrong...// #include<iostream> #include<vector> using namespace std; int main() { int a,b,p; vector<int> v; cin>>a>>b; for(int i=a;i<=b;i++) v.push_back(i);//inserting all values upto given limit in a vector.. for(p=2;(p*p)<=b;p++) { for(int n=2;(n*p)<=b;n++) { int s=(n*p); v.erase(v.begin()+s);//erase all multiples of 2,3....from … | |
Re: Hello, I'm trying to understand some things about derived classes: how to add something "extra" to existing functions in base class. My base class is "shape2D" like a rectangle, 3 functions: set values, calculate, show results. No problem here. Then I create a derived class named "shape3D". Please note the … | |
Re: I need to know which of these three copies of code is considered best. I also need to which one is more efficient memory wise and which is more efficient time wise. Thanks: enums [CODE]enum MyEnum{EnumTypeOne=1,EnumTypeTwo=2,EnumTypeThree=4,EnumTypeFour=8};[/CODE] macros [CODE]#define EnumTypeOne 1 #define EnumTypeTwo 2 #define EnumTypeThree 4 #define EnumTypeFour 8 typedef … | |
Re: Hi friends, I want to implement code which can take input from some other application. Like say for example ls | less Here, less is the application/utility which takes input from ls via pipe. I want to implement the same in C. I Did following things 1. Created PIPES using … | |
Re: #include<stdio.h> #include<conio.h> void main() { printf("enter number:"); scanf("%d",&n); for(i=1;i<=y;i++) { x++; } t=x; for(i=1;i<=y;i++) { t--; } y=t; getch(); } | |
Re: Hi, In below code snippet , can anyone let me know how to print the functor value output (3,4,5,6,7) without embedding add function in class. #include<iostream> #include<vector> #include<algorithm> using namespace std; void add ( int i) { i=i+2; } int main() { vector <int> vec ={1,2,3,4,5}; for_each(vec.begin(), vec.end(),add); for (auto … | |
Re: // Expect to print values of arr[0] to arr[4] #include <iostream> #include <vector> using namespace std; int main() { vector<int *> ptrList; int arr[] = { 0, 10, 20, 30, 40 }; int * ptrArr = arr; for( int i=0; i< 5; i++ ) { ptrList.push_back( ptrArr+i ); } vector<int … | |
Re: The title says it all but I am curious if it's acceptable or even efficient for that matter. If others were to read my code or work on a project with me is this generally accepted among others or yourself if you work on an enterprise level? Is this memory … | |
Re: When doing a linked list of chars with just a single character do you think it's better to use pointers in your struct like this? Typedef struct String_Node { Struct String_Node* next; Struct String_Node* prev; int id; char* c; } String_Node_t; Or better to not use a pointer with the … | |
Re: i know: - &varname is the adress of varname; - *varname is the value of adressed variable. but: void *Vvariant=NULL; friend ostream& operator <<(ostream &os,const variant2 &obj) { os << obj.Vvariant; //how can i get the value of adressed variable? return os; } how can i get the value of … | |
Re: i learned about 1D Array , 2D Array , 3D Array.But today , suddenly my friend asked my a question on "how to access Array Elements". i said "just use array with index".like a[0],a[1] and so on. and then he replied(it seemed that he knew very well about array) "is … | |
Re: Write a program with Recursive function that for every step will receive input from a number of until the digits 0 entered. After entering the digits 0 It should be entered into the numbers entering printed in reverse order Track. | |
Re: Here is a function to print my binary search node tree, void printtree(struct node *tree) { if (tree!=NULL) { printtree(tree->left); printf("%s %d\n",tree->word, tree->lineNumber); printtree(tree->right); } } How would I save what I print to a text file??????? | |
Re: I have read a text file to console and printed the file after reading, int textLength=0 int c; int c; FILE *file; file = fopen("ModestProposal.txt", "r"); if (file) { while ((c = getc(file)) != EOF) putchar(c); //fclose(file); } textLength = strlen(c);//get the length of the text How come I can … | |
Re: write c++ code that has a function int GreaterThan (int array [], int size, int searchItem). The fucntion should count and return number of elements in the array greater than SearchItem. you are free to generate the element randomly or let the user enter them, the size must be less … | |
Re: 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**'. … | |
Re: i have assigned a value directly to a pointer like *ptr=12; and i have used it,no error came.if we assign like this where the pointer points to?explain me? | |
Re: Dear pals, I installed Turbo c for windows 7 ultimate 64 bit , but it's not user friendly .When it use in full screen the mouse is not working . Any solution for it ? If you know any new C compiler setup let me know. Thanks, Anes | |
Re: /*Hi, I was trying to optimize my application in C. In that process to reduce the complexity at condition checks which of the below is efficient,*/ if(bFlag1 && !(Var == 1) && bFlag2) //or if(bFlag1 & !(Var == 1) & bFlag2) | |
Re: #include<stdio.h> #include<conio.h> #include<math.h>> main() { int k,i,r,n,j,a[100],m,p,b[100],count=0,count1=0,q,w,g,h,l,z,x,x1; printf("enter the length of the data word:"); scanf("%d",&k); printf("\nenter the data word:"); for(i=1;i<=k;i++) { scanf("%d",&a[i]); } r=1; while((k+r+1)>pow(2,r)) r++; printf("\n r=%d",r); n=k+r; j=1; m=0; for(i=1; i<=n; i++) { p=pow(2,m); if(i==p) { b[i]=0; m++; } else { b[i]=a[j]; j++; } } printf("\n INTERMEDIATE CODE … | |
Re: Hello, I was just noticing that the 'const'ness of references often causes me to rewrite a large chunk of my code with pointers. For example if I have a class that needs access to a large amount of data from another class I would love to use a reference. However … | |
Re: plzz help me with this program #include<iostream.h> #include<conio.h> int sum(int s); int sum(int x); int sum(int j,int k); float sum(float p,int q); float sum(float y,float z); void main() { cout<<sum(0)<<"\n"; cout<<sum(3)<<"\n"; cout<<sum(6,7)<<"\n"; cout<<sum(5.5,8)<<"\n"; cout<<sum(4.9,3.5)<<"\n"; getch(); } int sum(int s) { return s; } int sum(int x) { return x; } … | |
Re: difference between overloading and overriding ? | |
Re: Hi everyone I'm studying the part about while-statement but I don't understand the explanation in the book really well and the example doesn't work for me so I can't see it with my own eyes how it works. Can someone explain what the while-statement means and does? Also can you … |