15,551 Topics

Member Avatar for
Member Avatar for califguy

[code=c] #include<stdio.h> #include<stdlib.h> main() { char a[32],*a1,b[64],*b1; a1=&a[0]; b1=&b[0]; a1="hellohellohellohellohellohello" ; printf("\n contents of a1: %s\n",a1); int i =0; for(i=0;i<=31;i++) { printf("%c",a[i]); } } [/code] So why does printf ("%s",a1) work correctly while printf("%c",a[i]) display junk ? Since a1 points to a[0], shouldn'it it display the same values ?

Member Avatar for califguy
0
112
Member Avatar for califguy

hi guys, I have a simple question and I am new to c, Would appreciate any advise I could get. Here's the doubt. [code=c] main() { char a[10],*a1,b[10],*b1; a1=&a[0]; b1=&b[0]; int x=0; for (x=0;x<=1-;x++0) { *a1++=*b1++; } } [/code] Basically if I had a string in b[10] it would get …

Member Avatar for califguy
0
84
Member Avatar for inim38

Hi, Can you plz help me in creating a file in C having columns rec_id (int), score (float), hour (int), no_clicks (int) with rec_id values ranging from 1 to 100, score values initialized to 0.11, hour values initialized to 0 and no_clicks values also initialized to 0. And then generating …

Member Avatar for inim38
0
118
Member Avatar for makubexiii

how can you make program using a linked list that displays your outputs in ascending alphabetical order? we are only allowed to use: #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> TIA

Member Avatar for makubexiii
0
1K
Member Avatar for Jawahar prabhu

hai ia have been try this but i didnt get any output on my run window. #include<process.h> main() { system("echo hello"); } [B] consider me[/B]

Member Avatar for Aia
0
77
Member Avatar for TooMpa

Hi have a problem, this code should read a file and then save it in a linked list, just the <uid><name> from a lie looking like: <username>:<password>:<uid>:<gid>:<fullname>:<home dir>:<shell> I can't find the segmentation fault error atm, but hints on the code would be helpfull. Atfer the insert in user list …

Member Avatar for ArkM
0
203
Member Avatar for ahspats

Hey everyone, I am supposed to write a program that counts the number of vowels in string of characters. It must include "Struct counter_t (it must be declared as in the code i've written)" and function "int CountVowels (IN text[], OUT Count)". the OUT parameter must be of type counter_t. …

Member Avatar for ahspats
0
140
Member Avatar for Demonisya

Hi!!! This is my first time to post here and I have a problem and I want your help..... This is the case my teacher gave me a question to add 1 to 100 using while loop and its really confusing me... but here is my idea and I jsut …

Member Avatar for Demonisya
0
114
Member Avatar for devnar

[CODE=C]#include<stdio.h> #include<conio.h> int main() { float a=0.7; if(a<0.7) printf("C"); else printf("C++"); getch(); return 0; }[/CODE] The above code prints 'C'. Whereas the following two codes prints 'C++'. Why is that? [CODE=C]#include<stdio.h> #include<conio.h> int main() { float a=0.7; if(a>0.7) printf("C"); else printf("C++"); getch(); return 0; }[/CODE] [CODE=C]#include<stdio.h> #include<conio.h> int main() { …

Member Avatar for smart_pc
0
580
Member Avatar for xxxa_u_r_axxx

Hi! I'm just having a problem in displaying strings of line in the command prompt. My program is to search a string and enclose it with three asterisks both sides. Though it's functioning... But the problem is the program show only those lines where the strings are present. Thr program …

Member Avatar for Narue
0
144
Member Avatar for Sarav01

Hi All, Please help with the below Valet Parking Problem. Let me know if you need more info. The valet parking problem: Some fancy restaurants (i.e. ones without a drive-through window) offer a valet parking service with which one of the restaurant's employees will park your car for you as …

Member Avatar for Sarav01
0
291
Member Avatar for xxxa_u_r_axxx

Hi! My code is to search for the strings. Example when you type srtool.exe -s in -f sample.txt (in the command prompt), all the words containing "in" will be changed to ***in*** My problem is all words containing in will change to ** (one asterisk per word) instead of ***in*** …

Member Avatar for iamthwee
0
96
Member Avatar for mancode1007

I am very confused how to write a function which can accept 3 input parameter to calculate sum and average.the sum and average should be returned through output parameter ... pls help ..thx

Member Avatar for Majestics
0
98
Member Avatar for Himanshu1984

hi, I am developing an application in Windows CE platform is Windows Ce .net 4.2. i need to play media file through C code, i have managed to play media file in win32 through "system" command but this command is not available for Windows CE, i have tried CreateProcess function …

Member Avatar for Himanshu1984
0
280
Member Avatar for asifjavaid

hi all, I want to convert a string contain hex format '0x15' and what to convert it integer because i want to write data contain by a integer variable in hex format (binary data) into the file. here is my code [code=c] char * str = "0x15"; int value; FILE …

Member Avatar for Narue
0
4K
Member Avatar for nuceyneky

Basicly i tried to do address book but i guest it not work at all..can i know where i get wrong or any advise?..

Member Avatar for Narue
0
76
Member Avatar for Jayeeta Mitra

How to create an initialised list and delete any node from the list using C language.Please help me.I need it urgently.

Member Avatar for Nick Evan
0
80
Member Avatar for kcpatron

good day, i rily nid help on something.... its about gotoxy in turbo c... 1st of all, can u use gotoxy in turbo c? (c++ 6.0) 2nd, if u can... can i ask how to use it? please help me... im just a beginner... lol.... h0pe u c0uld help me... …

Member Avatar for Ancient Dragon
0
108
Member Avatar for haveaclick

hi all i want the code for reversing a string eg : I live in india Ans India in live i

Member Avatar for Nick Evan
0
89
Member Avatar for Hannahlv

Hello everyone, I don't know what is the exact name to call this, so I call based on what I want to do in my program. Its operation got something similar to chat server and client. I have server and client application. Firstly, when one client connects to server and …

Member Avatar for ArkM
0
114
Member Avatar for Jayeeta Mitra

How to initialise a sorted list and after inserting any node the resultant list also becomes sorted.Pls help.I need it urgently.

Member Avatar for Narue
0
60
Member Avatar for Diode

So I'm messing with some code, trying to get more familiar with string functions, and I stumbled into an apparent error on my part. Here is my code: [CODE]#include <stdio.h> #include <string.h> int main(void) { int len = 0; char *str = "This is a string"; char ch = '\0'; …

Member Avatar for Diode
0
2K
Member Avatar for ivylim88

i need to write a program that is acting as a simple personal address book with the record of name,email and phone numbers. The range of function should have: searching existing records. adding new records. deleting existing records. i need to include the last update date and time of the …

Member Avatar for ivylim88
0
146
Member Avatar for winky

I am supposed to rewrite the code below to "compute the number of digits to any base(such as base 2, base 16, base 8)." Just wondering if any of you can provide any explanation or pseudocode on how to go about doing this? Thanks for any help you can give …

Member Avatar for Narue
0
98
Member Avatar for hikaru1239

I am working on a code which opens a file (infile), copies it to an output file (outfile) and then asks the user for a string and searches for that string in the outfile and replaces every occurence of that string with & symbol. Here's an example: Contents of infile: …

Member Avatar for iamthwee
0
174
Member Avatar for hiraksarkardg

I'm a IT newbie...one day a CST student asked me whether there is any way to write something at a particular location or not.....so am forwarding it to you all. Please guys help me..

Member Avatar for Ancient Dragon
0
117
Member Avatar for draak13

I had gotten my code all working, and everything is capable of doing what it's supposed to do. The next step for me was to organize it a little better; re-allocating my definitions to different source code files and that such...and there the problem starts. After declaring three dyanamic link …

Member Avatar for draak13
0
96
Member Avatar for bluesy

how to add and delete record of contact in address book??? i'm using void searchContact(void) to search the contact and i have done it but i don't know how to proceed. i'm trying to use void addContact(void) {} void deleteContact(void) {} to do but i really don't know how to …

Member Avatar for Ancient Dragon
0
141
Member Avatar for watercolour

so far i already reach this line, but what make it pain in the ass is, i can't really seem to solve [B]how to make multiple operation in one execution[/B], i can only manage make it one operation in time, some say i have to [B]convert the operation like "1.22*3+2.1" …

Member Avatar for watercolour
0
120
Member Avatar for hiraksarkardg

Can anybody help me to do this program ? Problem is to write a program which will take another program as a input & it'll give a program flow chart. Ability of processing loops and if-else block would suffice. I can't understand where to start.

Member Avatar for ssharish2005
0
95

The End.