19,876 Topics

Member Avatar for
Member Avatar for Xufyan

how can i add the last value to the current value using loop..? i tried so much but didn't find the answer :( [CODE]void main(void) { int numbers,add,sec; clrscr (); for (numbers=1;numbers<=49;numbers++) { for (sec=numbers;sec<=numbers;sec=numbers+sec) printf ("%d ",sec); } getch(); }[/CODE] here the loop is from 1 to 50, i …

Member Avatar for Xufyan
0
102
Member Avatar for Cheran

hi everyone... i"ve to pass a string as a returning value.but wat is the problem is there is an integer in the middle of it.the problem arise here.. [code]char* my_string( char* dest,char *c) { char str1[25] = "C:\\windows\\"; char str2[25]; char str3[25] = ".jpg "; strcat(dest,str1); //append str2 to str …

Member Avatar for Aia
0
142
Member Avatar for pramoda.ma

Hi All, How to copy one 2D-array to another without using loops and library function of C. Not pointers. Regards, Pramod

Member Avatar for Ancient Dragon
0
5K
Member Avatar for mariosbikos

hi guys i have an urgent problem....we have been asked to make a battleship game in C which will have the formation of ships taken by a file txt.....for example 00000000 ppp00000 0000nnnn 00000000 etc...i want to open the file txt and then put every single character 0,p,n etc to …

Member Avatar for mariosbikos
0
293
Member Avatar for deeep

Hello Guys, I have implemented a linked list. And my output looks something like dis: ************************************************* The elements in the list : address is = 163196952 ADOC1100250100000119666 address is = 163196968 ADOC1100250100000119666 address is = 163196984 ADOC1100250100000119666 address is = 0 ADOC1100250100000119666 TOTAL NO OF ELEMENTS IN THE LIST ARE …

Member Avatar for jephthah
0
171
Member Avatar for shahab.burki

Hi, I am stuck in file reading problem. I have tried various solutions but nothing worked. Actually I can't develop a logic to do so. I want to read some lines from file and pass them to structure. When reading a file you must use WHILE loop. I am posting …

Member Avatar for jephthah
0
98
Member Avatar for buckkitty

Does anyone understand why Data2 would not equal Data? I print, and can see, that they LOOK the same, i.e. have the same number of rows and columns with the same values in each element. But when I pass the matrices to a calc function, they give different results. I …

Member Avatar for buckkitty
0
89
Member Avatar for ericas5

New to C and haven't had any problems until now - I can seem to get straight with passing arrays between functions. Here is what I need to do: Write a program that declares 3 single-dimension arrays named bookPrice, numBooks and totAmt. Each array should be declared in main() and …

Member Avatar for ericas5
0
149
Member Avatar for denis_stoyanov

Well i'm just starting to study recursion and i have a small problem. I'm trying to write a program which generate every six digit combination where every digit is used only one time. I've writed an iterative (i think this is the correct term) : [CODE]#include "stdafx.h" using namespace std; …

Member Avatar for Banfa
0
84
Member Avatar for Muhammadlodhi

[I][B][B][/B][/B][/I] i want to put the answer like user enter any odd number then out put will be like this one if 3 *** * * *** the even rows shows only 1st and last stars LIKE 5 ***** * * ***** * * ***** [CODE] int main(){ int num,i,j,k,l; …

Member Avatar for Muhammadlodhi
0
261
Member Avatar for Iam3R

what is the correct declaration of pointer to a pointer to array of N elements. ( i want to store address of pointer to an array of n elements ) i am using the below declarions seperately , but getting errors. [CODE] int (*p)[4]; int (*p1) (*)[4] = &p; int …

Member Avatar for UncleLeroy
0
143
Member Avatar for kedarm

Hi! I'm trying to use the nanosleep and sleep functions in a program I am trying to write. I first tried this - [CODE] fprintf(stdout,"Hey guys.."); struct timespec t_req, t_rem; t_req.tv_sec = 1; t_req.tv_nsec = 500; if (nanosleep(&t_req, &t_rem) < 0) return 0; fprintf(stdout,"...What's up?");[/CODE] Since the function nanosleep did …

Member Avatar for mitrmkar
0
955
Member Avatar for Sparky89

Hy everyone, I got a problem with doin a sum of a column where are only "int" datas, I get those data from Sql Db with a Sql Data Source and use that sds with a nested gridview. I tried with select sum() but it for each employer i get …

Member Avatar for Sparky89
0
205
Member Avatar for suranga_kas

Hi, Following is the issue im having.... Im working on a checkers game using c#. ive decided to set each checker within a picturebox that will be displayed inside a panel (gameboard) however the problem comes when I have to move the checkers. I could write code to move the …

Member Avatar for Geekitygeek
0
158
Member Avatar for shahab.burki

Hi, When I assign the value of one structure variable to the other I got the error "incompatible types in assignment". The Code is the following. The Problem line is 91. [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> struct file_data{ char src_ip[18]; char dst_ip[18]; char src_port[8]; char dst_port[8]; char p2p_proto[18]; struct …

Member Avatar for WaltP
0
156
Member Avatar for alcx88

I am having troubles getting my program to work. It is supposed to take integers from a file and put them into an array. Then it is supposed to sort them by the bubble sort algorithm. [CODE]#include <stdio.h> #include <ctype.h> #include <stdlib.h> #define N 10000 int main(int argc, char *argv[]) …

Member Avatar for Adak
0
131
Member Avatar for avazim

I want know if there any way to write command to cli by using c#. That because I want to write simple GUI program wich writes command like "ping" "telnet" to the CLI of windows. thanks alot

Member Avatar for kvprajapati
0
80
Member Avatar for LMat619

Hello everyone! I am new to this forum (and C programming) but I hope that I will be able to master C help anyone out with problems in the coming months. But I am having trouble with my own program for an assignment. I am asked to simulate a user …

Member Avatar for WaltP
0
249
Member Avatar for coder19

[CODE] void MatchWord(Match temp, int duplicatedoc, int originaldoc, string * words) { Idea is to send in a match and then call the binary search on the matching words and see if they are found. If they are found, give them a higher weight and if not found, give it …

Member Avatar for vmanes
0
131
Member Avatar for bigdawgg

I am attempting to write some code that will open a sequintal file into arrays and will then can use the data to calculate monthly payment. the text file is as follows 1 5 10 20 50 2.5 4.1 5.3 7.1 8.3 With the top row being yrs and bottom …

Member Avatar for jwenting
0
192
Member Avatar for buddy1

I'm having some trouble translating the following C++ program to Pep/8 assembly language. Can anyone help me solve this. This is what I have come up with. [code=cplusplus] #include <iostream> using namespace std; int list[16]; int i, numItems; int temp; int main() { cin >> numItems; for (i = 0; …

Member Avatar for mjmakl
0
2K
Member Avatar for Muhammadlodhi

HI i made this program for odd inputs if press 5 then ***** * * ***** * * ***** but not showing the correct answer. write a right code if u can plz thanks alott. [CODE] #include <stdio.h> int main() { int num, i; printf("press any odd num"); scanf("%d", &num); …

Member Avatar for jephthah
-2
291
Member Avatar for Muhammadlodhi

I need your help AT ONCE plz IN C CODE ONLY i have a program to make an array of length 30 and NOW write equation like this ((3+4)-(24/5)) .... the paranthesis must be balance and the output of the operation must be shown IF paranthesis are balanced. HELP ME …

Member Avatar for Nick Evan
-5
136
Member Avatar for Muhammadlodhi

Hey guys and girl i need your help in program only in C CODE user press only odd numbers then the following result has been shown like if 3 then *** * * *** if 5 then ***** * * ***** * * ***** PLZ HELP ME >>>> Thanks

Member Avatar for Salem
-2
364
Member Avatar for geekgirl2011

I am so lost in this programming assignment. Here is what I am suppose to do: A. Define a struct that represents a CAT as follows: A CAT has a weight, name, and a neutered flag, i.e., those are the components of the struct. Use a typedef. B. Declare a …

Member Avatar for jephthah
0
202
Member Avatar for fullyarmed

I have this Lab for a class that I am taking.. It works as it suppose to... The problem I am having is that if I enter more than 11 char it goes all crazy.. I don't want it to do that... [CODE] #include <iostream> #include <cstring> using namespace std; …

Member Avatar for fullyarmed
0
209
Member Avatar for riahc3

Hey I rather not use conio.h for cross compatibility so is there any way to make my own "conio.h" and just include it in my compilation. Thanks.

Member Avatar for jephthah
0
1K
Member Avatar for sangramanand

hi all, i created a window using c, next i want to add a text box in the window. Since am working on 32-bit, i donno which functions to use in that.... pls suggest me the procedure to implement this......

Member Avatar for jephthah
0
48
Member Avatar for reshmasalian

heya, watz de meanin of malloc.h n alloc.h in c-programmin(both are different)? what is the difference between 1 pointer n 2 pointer in link list of stack? wat is the meanin of arrow mark pointer?

Member Avatar for sanji17
-4
195
Member Avatar for LostnC

Hello everyone, I am trying to understand composition versus inheritance in C++. I have looked at many web pages, but I haven't found anything that makes sense to me. Can someone please tell me where I can find some examples of programs that might make sense to me? I am …

Member Avatar for mrnutty
0
206
Member Avatar for teomurgi

Hi all, in a piece of code like this: [CODE] void Logger::logMsg( int msgLevel,const char* msg) { char input[strlen(msg)]; ... } [/CODE] is the input array dynamically allocated? In this case, do I have to use the delete [] in order not to have a memory leak? thank you!

Member Avatar for vmanes
0
342
Member Avatar for FinalDecap

This is probably a really stupid thing to ask considering the development I'm doing (effectivly creating a virus scanner), but how do I link classes/cpp files? I have 3 applications/sections that I can compile/combine with a makefile, that's fine, but I need them to run 1, 2, 3 once the …

Member Avatar for FinalDecap
0
221
Member Avatar for hkBattousai

This sample code is from [URL="http://msdn.microsoft.com/en-us/library/aa287786%28VS.71%29.aspx"]MSDN[/URL]. [CODE]private string name; public string Name { get { return name; } set { name = value; } }[/CODE] I looked several examples, and they are the same. Why do we keep two different properties to store the name, namely "name" and "Name". I …

Member Avatar for hkBattousai
0
426
Member Avatar for thriek

Hello. Just asking any fellow nerds out there who program games with c++ or know about it..... about libraries. I know c++ and a few non standard libraries. What I want to know, is what non standard libraries or extras i could use with my compiler to make professional standard …

Member Avatar for baune
0
167
Member Avatar for lewashby

I'M reading the book "Beginning C# Game Programming by Ron Penton". The book is instucting me to create a small framework for a game, the problem is, the book was written for VS 2002 and I'M using VCs 2008 express. I'M instructed to add references to the project, two of …

Member Avatar for Gospp
0
319
Member Avatar for urbangeek

the code is: [CODE] slen=strlen(str); for(count=0;count<=slen;count++) { flag=0; if((int)str[count]!=32) { for(count2=count+1;count2<=slen;count2++) { if(str[count]==str[count2]) { flag=1; break; } } if(flag==0) { ar[ar_count]=str[count]; ar_count++; } } }[/CODE] at line 5 the != operator working fine but when i put [ICODE]if(((int)str[count]>=65 && (int)str[count]<=90) || ((int)str[count]>=97 && (int)str[count]<=122))[/ICODE] it's not working.. if you've some …

Member Avatar for WaltP
0
167
Member Avatar for hosam2k

hi all im stuck to my assignment 1. i want to know how to use function search in order i can search each character in a string then count the number of it. for example: given : home alone the output will be : the string has 9 characters including …

Member Avatar for Adak
0
144
Member Avatar for shahab.burki

Hi, I am working on structures. One of the structure member is char array i.e string. When I assign another string to this then it throws the incompatible error. The code is the follwing. The problem line is commented. Code: [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> struct file_data{ char src_ip[18]; …

Member Avatar for shahab.burki
0
176
Member Avatar for Marine4God

Hello, I'm trying to write a function that uses a C++ string object as its argument, and returns the character that appears most frequently in the string. How would I write this? Is a for loop necessary? Thanks for the help.

Member Avatar for vmanes
0
110
Member Avatar for Xeros606
Member Avatar for Vytautas

Hello, I'm trying to open file using a function in a header file and I think it works but I'm unsure if it's written as it should be. Should I use double pointer inside the FileOpen function like argv is or not? It also works without double pointers and that's …

Member Avatar for JuhaW
0
108
Member Avatar for shahab.burki

I have created a linked list which stores data from file. However I got stuck when I try to print the contents of Linked List. The code is below 1.Text File [CODE]102.15.12.10 15.14.106.6 1591 1592 bit_torrent 102.15.12.10 15.14.106.6 1591 1592 bit_torrent 102.15.12.10 15.14.106.6 1591 1592 bit_torrent 102.15.12.10 15.14.106.6 1591 1592 …

Member Avatar for JuhaW
0
83
Member Avatar for sree_ec

Hi, i have some questions mostly regarding the memory segments... Can any one help me out.. 1. During a function call in C, where is the return value of the called function stored.. This is mainly a question came when i was thinking of steps during a function call. The …

Member Avatar for sree_ec
0
86
Member Avatar for tquiva

I am trying to modify this function to read input in a noisy environment, meaning the characters received in the input may have extra characters. A protocol that I am trying to implement is to send each digit twice in a row so that unless the receiver gets two of …

Member Avatar for nezachem
0
117
Member Avatar for sunnynight

Dear All, I have a text file containing these lines: [QUOTE]12345 12 123 1234 123456 1234567890 123456789032453 1234567890724832445 12345.123456 12345.123 12.12 12[/QUOTE] And I want to read them from c:\numbers.txt and store them into an array and then do some calculations, then save the results in another file(c:\results.txt). I have …

Member Avatar for Banfa
1
6K
Member Avatar for Etherwind

I'm getting a compiler error in one of my .c's that I don't understand. I'm getting [icode] Tree.c: In function 'newTree': Tree.c:301: error: expected declaration or statement at end of input [/icode] What I don't understand is that newTree and line 301 are completely separate functions. I can get the …

Member Avatar for Etherwind
0
174
Member Avatar for vino4all

How to get the following output using c? ---1 --12 -345 6789 Please guide me with the code. It can be a blank space instead of '-'.

Member Avatar for 0x69
0
369
Member Avatar for Mena samy

hello I am trying to send an array of character but when i receive it in the other processor i receive it with garbage !!! any suggestion? [CODE] #include <stdio.h> #include "mpi.h" int main (int argc, char *argv[]) { MPI_Status s; int size, rank; char line [128]; //char* str="hjfjh"; static …

Member Avatar for Mena samy
0
189
Member Avatar for COKEDUDE

Could someone please tell me what these errors mean and how to fix them. [CODE]inputter.c: In function âget_next_tokenâ: inputter.c:21: warning: initialization makes integer from pointer without a cast inputter.c:17: warning: unused variable âcur_posâ[/CODE] [CODE]/* Get an RPN expression from the keyboard. * Accepts q as indictation that user wants to …

Member Avatar for jephthah
0
178
Member Avatar for KozZZak

Hello, I have a problem, I needed a change from C++ to C#. help anyone? I made it from this: ( This is script in C++ [CODE]using namespace System; using namespace System::Text; using namespace System::Net; using namespace System::Net::Sockets; String^ chr(String^ str) { Char^ c = Convert::ToChar(Convert::ToInt32(str)); return Convert::ToString(c); } Int64^ …

Member Avatar for KozZZak
0
278

The End.