- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 9
- Posts with Downvotes
- 8
- Downvoting Members
- 7
Me in C world
- Interests
- Basketball, programming, photoshop
72 Posted Topics
Re: > Write a C program to Remove even numbers and fill it with zeros. > Note: You can use only one loop for your logic. > Two variables apart from the array. > Input array 1,2,3,4,5,6 > Output 1,3,5,0,0,0 I think this suits the problem. I used goto instead of … | |
Hello, I'm trying to display the google map in a bootstrap modal. But only a part of the map is visible not the complete map. here's my modal code, followed by the javascript for the map <div id="geo_modal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" … | |
I have a rich text box in my winform. I want to format the text so that i can write a simple C code in it. I mean the indentation should be done accordingly (like the code tag on websites). Is it possible?? | |
Hi everyone, I was going through a tutorial blog for speech recognition, and tried the following code Which is supposed to print "Hello world" on the screen. But it generates an error InvalidOperationException on line 16 and says "The language for the grammar does not match the language of the … ![]() | |
I'm using a TableLayoutPanel which will contain a few dynamically generated LinkLabel's I get everything except the extra spaces in 1st and 2nd row. I've attached a snapshot through screecast. Can anyone tell me how to remove this extra thing? Heres the snap shot link : http://screencast.com/t/dZqRzSZU | |
Hi everyone, I know that we can pass string as command line argument and use it as we want. But, can we pass a text like "this or that" (with several spaces)?? Is there any way?? | |
odd mountain is a list of odd numbers going up from 1 and then back to 1. e.g. odd_mountain of size 5 is [1,3,5,3,1] odd_mountain of size 4 is [1,3,3,1] Hint: use the list functions and a builtin function. Can anyone help me in this? all my tries are going … | |
I found this question on the internet, > Create a text file with name filename and about size bytes. The file should contain > an incrementing number on each line starting with 0. (ie) 0, 1, 2, 3, .... as many are required to make the file size > just … | |
I wrote a code which fills numbers into the file and when the file exceeds the size given, it stops adding data. But whenever i run the code there is an indefinite run in the data and the size of file just goes off the chart! Please help!! def create_file_numbers(filename, … | |
I have a generator function, i've filled in the function if there are no more_seqs. But I feel trouble if there are more sequences. I need to generate 1 tuple at a time. if the function call is generate_zip(range(5),range(3),range(4),range(5)) then the tuple generated should be (0,0,0,0) (1,1,1,1) n so on … | |
I have a list say word = ["engine","ant","aeiou"] I need to sort the list according to the number of vowels in the list elements. And this sort must change the input as well. I tried writing the code, by using zip() and a few ops i'm getting the required answer … | |
Hello everyone! I got this question in a book.. I thought of doing it using map() or using loops return the first count multiples of number in desc order in a list. e.g call with input (3,2) returns [6,3] call with input(5,3) returns [15,10, 5] but the hint along with … | |
I was trying to solve the Euler problem number 50, and wrote the following code and got the answer as, no. of primes = 536 and prime value is 958577 But, when i search the answer for this on internet, it says 543 primes and prime is 997651 why does … | |
Hi, I was working on an application but i'm stuck at a point now.. I'm able to send the chat messages but unable to receive any... I have two threads, 1 for sending message and another for receiving but receiving part isn't working! I think the problem is with multithreading! … | |
Hi, I am using gcc compiler to compile the program and build an exe I used this command to compile gcc program.cpp -g -o program (generates program.exe and runs fine) But, if i write the same thing in system("gcc program.cpp -g -o program"); programmatically, then the exe is generated but, … | |
Hi everyone! i'm getting strange outputs for the following code.. can anyone explain the reason for such output?? :/ I use DEV c++ int color_choose(void) { char clr[10]; int i; /*enum { green,aqua,red,purple,yellow,white }a;*/ printf("\n\n\tText color can be changed here! This the list of available colors: "); printf("\n\n\t Green\t Aqua\t … | |
hi.. I'm trying to read a .docx file using apache poi api methods.. But i'm facing a few problems.. Can anyone suggest me the changes to be made in this code?? package apiole; import java.io.*; import org.apache.poi.xwpf.extractor.XWPFWordExtractor; public class Apiole { public static void main(String[] args) throws IOException { File … | |
I wrote a program, in which my code is checking the word entered by user and the word in a file. If the words are not same, the file is deleted. i closed the file using **fclose(fp)**, (where fp is file pointer) and to delete the file i used **system("del … | |
I'm new to win32 application building using C. I'm using DEV C++ and I'm able to get a window, by using the "windows application" icon in DEV. I want to know how to display our text on to the window??? That'll be very helpfull! This is the readymade code generated … | |
How to manipulate .doc files using c++ ??? I'm working on a project which needs this manipulation.. But, I feel that it is not possible to manipulate .doc files :/ can anyone help me out here?? | |
Hi, I'm working on a small project and i'm stuck in a part where I need to replace the existing word in file with a new one. I really have no idea about it.. I'm posting the function block where i'm facing the problem void team::team_list() { string str = … | |
hi everyone! I'm working on project which Generates certificates for different students. The interface takes the input of Name, College, Secured position and generates the certificate... but I want to generate all the certificates at once. So, to avoid overlapping of the file names, i want to generate different file … | |
#include <iomanip> #include <iostream> using namespace std; int main() { cout << left << setw(10) << "Hello"<< "*" << right << setw(4) << "World\n"; } is the above code correct?? I think the alignments are not working for me.. MY output Hello^^^^^^^^^*World (represented spaces as ^) | |
Hi.. can anyone tell me what is the meaning of this error?? [Error] cannot convert 'std::string {aka std::basic_string<char>}' to 'char*' for argument '1' to 'char* strcpy(char*, const char*)' When I'm taking TeamName as char TeamName[30]; , the compiler shows linker error. what could be the problem? I use DEV C++ … | |
Hi, I wrote the following program for stacks using linked list! But, the display function doesn't seem to work! can anyone point out the errors in this? Thankyou! #include <iostream> #include <cstdlib> #include <iomanip> using namespace std; template <class T> class stack { T data; stack<T> *top; stack<T> *next; public: … | |
Re: I don't think there is any use of iostream in this program as you're using scanf() not cin | |
What would be the error code for this?? Am I using perror() at right place?? The output shows "No error" #include <stdio.h> #include <conio.h> #define MAX_VAL 32000 int main() { start: int x; printf("Enter a value for x= "); scanf("%d", &x); if (x > MAX_VAL) { perror(""); getch(); system("cls"); goto … | |
Re: > wait i think the only thing to explain is....scanf("%ld", &n);....i dont get it... %ld is used because the datatype is long. in c++ u can directly use cin>>n; | |
Re: I Agree to what decepticon said. As the object you've created is for Addition class hence Addme.num1 and Addme.num2 has a seperate box (group) for storing values (which is different from Subtractme.num1 and Subtractme.num2). Hence, the sum will be given by Addme.ExecuteAddition() because you've provided values for Addme.num1 and num2. … ![]() | |
Hey! i've been trying to create a header file using dev C++ but i'm stuck with sum errors. Can anyone help me out in this? #ifndef SUM_H #define SUM_H template <class T> class add { private: const T a,b; public: T sum(T,T); void displaysum(); }; template <class T> T add::sum(T … | |
Re: > you tried to do with It's not his code. It's someone else's code ;) | |
while((c=getch())!=13) { pass[z++]=c; printf("%c",'*'); } I used this while loop to take the input of the password. Everything works fine until no "wrong" key is pressed. the problem is, suppose, if i press a wrong key n i want to delete it (backspace) then even backspace is taken as a … | |
Re: > function to go back from the main program. is that considered as loop? its not loop. Its just "calling the main function" we don't consider it a loop. | |
hey, i've been trying to insert the element in the linked list, but I don't understand why the element is inserted at some other position i.e. it is not inserted at the position which i pass. is there any error in the insert function? template <class T> void insert ( … | |
Re: > system("pause"); since your actual problem is solved, I'd like to suggest one more thing. using system("pause") to hold output on screen is a bad idea. use std::cin.get(); or directly cin.get(); //if you have declared using namespace std which is more standard than a system call. you can have a … | |
Re: try it using stdlib header instead of process.h If you are using windows, then you'll get the desired output! system("DATE"), system("ipconfig/all") are not illegal commands | |
Re: > and try to use fgets dont use gets() .because now only i learned this topic recently we use fgets() because gets() doesn't allow to specify the length of buffer to store string whereas in fgets we are allowed to give max string length. here's the syntax: fgets(s,sizeof(s),stdin); | |
Re: Just replace the '+' sign in the addition logic of "Addition of matrices" program with '-' we don't provide ready made codes.. Hope you know the addition of matrix program! | |
I have a little problem related to the white spaces in my program. Well, the actual program I'm trying to make is something else. so this program is just to check whether the text is properly broken or not. The problem I'm facing is, for the first word in my … | |
Re: if(root==NULL) has no meaning at all... decepticon is right! condition must be root!=NULL ![]() | |
Re: > Must use at least two functions, not including Main For this, you have to use macros. you'll have to define two functions which indirectly point at main(). You will not see main() written anywhere in the program but it actually gives a logical call to main(). Give it a … | |
Re: yes, It is present in the directory where the executable and object file are present (where you save your program). and, as deceptikon told you, semi colon is the problem. Program displays "File could not be opened" because the file is not there, for reading the file **"new"**, you first … | |
Re: > So, it means impossible to get the same value? Using float?? no! (reason:as said by deceptikon) > How if I change the data type become double? yes, you'll get same value if you use double. | |
How can i give an icon to the exe file produced after executing my code?? is it possible?? | |
Re: place a null character i.e. '\0' after the loop (between 12-13) lines as soon as compiler gets a null character, it terminates the string. | |
Re: go for these books, learn the syntaxes, then post!! http://www.daniweb.com/software-development/cpp/threads/70096/c-books | |
Re: instead of #define, use typedef keyword.. this keyword is actually meant to define a different name to the existing keyword. so i think that will be more preferable. | |
Is there any way to create an installer using C programming..? I want embed all the files of a software created by me in an exe file, which will extract all the things to a desired folder or drive. I heard that we can make batch file(package).. but how to … |
The End.